V
vengala s reddy
I am using a simple grid with 4 columns
column0 int identity
column1 varchar
i am using the following code
Private Sub kbGrid_UpdateCommand(s As Object, e As
DataGridCommandEventArgs)
Dim MyCommand As SqlCommand
Dim strConn As New SqlConnection("****")
Dim id as TextBox = E.Item.cells(2).Controls(0)
Dim name as TextBox = E.Item.cells(3).Controls(0)
THE NAME.TEXT VALUE IS GETTING THE OLD VALUE INSTED OF THE CHANGED
DATA I TYPED IN THE TEXTBOX NAME, AM I MISSING SOMETHING HERE.
dim strUpdateStmt As String
strUpdateStmt ="UPDATE testGrid SET name = '" & name.text & "' WHERE
id =" & id.text
MyCommand = New SqlCommand(strUpdateStmt, strConn)
response.write(strUpdateStmt)
'strConn.Open()
'MyCommand.ExecuteNonQuery()
'kbGrid.EditItemIndex = -1
'strconn.close
'kbGrid.DataBind()
end sub
THANKS IN ADVANCE.
column0 int identity
column1 varchar
i am using the following code
Private Sub kbGrid_UpdateCommand(s As Object, e As
DataGridCommandEventArgs)
Dim MyCommand As SqlCommand
Dim strConn As New SqlConnection("****")
Dim id as TextBox = E.Item.cells(2).Controls(0)
Dim name as TextBox = E.Item.cells(3).Controls(0)
THE NAME.TEXT VALUE IS GETTING THE OLD VALUE INSTED OF THE CHANGED
DATA I TYPED IN THE TEXTBOX NAME, AM I MISSING SOMETHING HERE.
dim strUpdateStmt As String
strUpdateStmt ="UPDATE testGrid SET name = '" & name.text & "' WHERE
id =" & id.text
MyCommand = New SqlCommand(strUpdateStmt, strConn)
response.write(strUpdateStmt)
'strConn.Open()
'MyCommand.ExecuteNonQuery()
'kbGrid.EditItemIndex = -1
'strconn.close
'kbGrid.DataBind()
end sub
THANKS IN ADVANCE.