Question : asp.net: Conversion failed when converting the varchar value ' + row.Cells(1).ToInteger() + ' to data type int.

I have this code. how can i resolve this error.
Conversion failed when converting the varchar value ' + row.Cells(1).ToInteger() + ' to data type int.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value ' + row.Cells(1).ToInteger() + ' to data type int.

------------------
I am having trouble with this portion of my code.???
' + row.Cells(1).ToInteger() + ')
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
I am gettin the current row id using the proc belo:
-----
Sub GridView2_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

        ' Get the currently selected row using the SelectedRow property.
        Dim row As GridViewRow = GridView2.SelectedRow

        ' Display the company name from the selected row.
        ' In this example, the third column (index 2) contains
        ' the year.
        MessageLabel.Text = "You selected row ID = " & row.Cells(1).Text & "."
        Dim currentrowID = row.Cells(1).Text
    End Sub
------------

I am trying to insert it into this insert statement:

 InsertCommand="INSERT INTO [CustomerImages] ([ImageID],[EquipmentID], [Title],  [ImageData], MIMEType) 
VALUES (@ImageId, (SELECT [EquipmentID] FROM Equipment WHERE ID =  ' + row.Cells(1).ToInteger() + '), @Title, @ImageData, @MIMEType)" >

Answer : asp.net: Conversion failed when converting the varchar value ' + row.Cells(1).ToInteger() + ' to data type int.

if request.querystring("season") = ""
Random Solutions  
 
programming4us programming4us