Click to See Complete Forum and Search --> : Help..Update web form datagrid


hooplife
January 10th, 2007, 12:08 PM
help i'm looking to make record update on datagrid to my database, but seems i cant get the correct coding for the update event, even i had manage to make the datagrid into edit mode, please help me!!!it's urgent....here is my coding:


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.OleDbConnection1.Open()
DataSet11.Clear()
Me.OleDbDataAdapter1.Fill(DataSet11)
Me.OleDbConnection1.Close()
DataGrid1.DataBind()

End Sub


Private Sub DataGrid1_EditCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.EditCommand
DataGrid1.EditItemIndex = e.Item.ItemIndex
Me.OleDbDataAdapter1.Fill(DataSet11)
DataGrid1.DataBind()


End Sub
Private Sub DataGrid1_UpdateCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.UpdateCommand

((((WHAT SHOULD I WRITE HERE)))

End Sub

Private Sub DataGrid1_CancelCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.CancelCommand

DataGrid1.EditItemIndex = -1
Me.OleDbDataAdapter1.Fill(DataSet11)
DataGrid1.DataBind()

End Sub