Hello! I am using DataGrid to display details from Ms Access. Few features such as Edit, Update and Delete are added, but they did not function. Can anyone help me? Thank you very much!!!
For the update function, am I suppose to write the commane : UPDATE <tablename> SET = "..."?
As I am using the "EditCommandColumn", so when I press the "Edit" link, everyfield will changed to textbox form, may I know what is that name for the textbox?
Here is the sub functions source code:
Sub DataGrid_Edit(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
Dim DBACmd As New OleDbDataAdapter(SQLCmd, DBConn)
DataGrid.EditItemIndex = e.Item.ItemIndex
Response.Write(DataGrid.EditItemIndex.ToString)
DataGrid.DataBind()
End Sub
Sub DataGrid_Update(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
DataGrid.EditItemIndex = -1
DataGrid.DataBind()
'BindGrid()
End Sub
Sub DataGrid_Cancel(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
DataGrid.EditItemIndex = -1
DataGrid.DataBind()
'BindGrid()
End Sub
For the update function, am I suppose to write the commane : UPDATE <tablename> SET = "..."?
As I am using the "EditCommandColumn", so when I press the "Edit" link, everyfield will changed to textbox form, may I know what is that name for the textbox?
Here is the sub functions source code:
Sub DataGrid_Edit(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
Dim DBACmd As New OleDbDataAdapter(SQLCmd, DBConn)
DataGrid.EditItemIndex = e.Item.ItemIndex
Response.Write(DataGrid.EditItemIndex.ToString)
DataGrid.DataBind()
End Sub
Sub DataGrid_Update(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
DataGrid.EditItemIndex = -1
DataGrid.DataBind()
'BindGrid()
End Sub
Sub DataGrid_Cancel(ByVal obj As Object, ByVal e As DataGridCommandEventArgs)
DataGrid.EditItemIndex = -1
DataGrid.DataBind()
'BindGrid()
End Sub