make datagrid editable

urvi_bhal

Member
Joined
Jun 29, 2005
Messages
14
Programming Experience
Beginner
hi,
I am using datagrid to show data contained in table ind database.
Now I want to make this datagrid editable so that i can add,update and delete data from datagrid and that shoud affect in database also...
I hope I will get answer very soon.
 
datagrid problem not solved

hi,
I tried to open that site but its not showing what I want. Please provide me the answer how to make datagrid editable.
thanks...
 
Ok if you have already made a data grid add a save button and use the following as an example you will need to make sure that the data adapter and data set are named after your own.
VB.NET:
Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
  
OledbDataAdapter1.Update (DataSet1)
 
End Sub
 
Hi,
Thanks for reply. But I think you don't understand my question. Actually I have datagrid in which data is coming from database. Now I want as soon as I click on particular cell that cell is converted into textbox or textbox appears in that particular row and the text in cell comes directly into textbox. so if I change that text in particular cell that data will be saved directly into database right from datagrid. now if I want to delete particular record from datagrid, I want that if I want to delete that record than If I check checkbox attached to that record on which I click and if I press delete button that that particular record will be deleted from datagrid and also from database. Is it possible?
I would really appriciate your answer,
thanks again
 
as far as i know ,the change made(deletion) in DATA GRID cannot be directly[AFFECT] done to the DATABASE because.REMEMBER vb.net uses a concept of DISCONNECTED ARCHITECTURE in any change made to the DATAGRID has to GO through DATASEt.
So my frend work on simultaneous updation of [DATAGRID,DATASET]then [DATABASE]
in same code written for button
 
Back
Top