Select Button at the datagrid
i having a datagrid which having a button Named select... it is select the row data and store into another table. Below is my code but it cant run.. Can anyone help me?
Code:
Private Sub details_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles details.ItemCommand
Dim sqlstr3 As String
Connect()
sqlstr3 = "Insert Into AssetMovement (Ass_Code, Ass_Category,Ass_Status,CheckInDate,CheckOutDate,ExpiryDate)" & _
"VALUES ('" & e.Item.Cells(1).Text() & "','" & e.Item.Cells(3).Text() & "','" & e.Item.Cells(8).Text() & "','" & DateTime.Now & "',' ','','" & "'30days')"
If (e.CommandName = "Select") Then
RunQuery(sqlstr3)
hidMsg.Value = "S"
Dps()
End If
Response.Redirect("frmAssetMovementList.aspx")
End Sub
Re: Select Button at the datagrid
Are you getting some kind of error when you try to run the code? If so, could you put the error out here...that might help a little bit more.
Jim P.
Re: Select Button at the datagrid
Step through your code, when the debugger reaches sqlstr3, get its value and try running it in Query Analyzer.