Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i am now using a datagrid to display my data from my database...

but i wanna user to be able to edit , update and cancel the information..

 

how should i go bout doing it...can somebody guides mi...

the code i have for edit and cancel are below...can anyone tells mi whether it'e rite anot...and if it's rite how should i go bout doing the update part...i have visited many sites but i dun understan....thanks

 

Source Code

------------------------------------------------------------------------------------

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

OleDbDataAdapter1.Fill(DataSet41)

DataGrid1.DataBind() 'Put user code to initialize the page here

 

End Sub

 

Sub DataGrid1_Edit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

DataGrid1.EditItemIndex = e.Item.ItemIndex

OleDbDataAdapter1.Fill(DataSet41)

DataGrid1.DataBind()

 

End Sub

 

Sub DataGrid1_Cancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

DataGrid1.EditItemIndex = -1

OleDbDataAdapter1.Fill(DataSet41)

DataGrid1.DataBind()

End Sub

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...