Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Haw to update
 

Haw to update

hi
i have created a dataadapter (ole) and i have createda a dataset
filled it and the result is displayed in a datagride i wnat to mdify the data in the datagride 
when i press the a button (cahnge it from the datgrid)
i have wrote this code

q1.AcceptChanges()
        AD.Update(q1)
but nothig happed wht is the problem can anyone tell me
MigrationUser 1  Monday, March 08, 2004 4:17 PM
AcceptChanges sets the rowstate property to UnChanged; because of this, the updated rows will not be posted to the database.  (Their state is unchanged).

You'll have to call the Update member of the DataAdapter first, en after that you'll have to call AcceptChanges:


AD.Update (q1.GetChanges());
q1.AcceptChanges();
MigrationUser 1  Tuesday, March 09, 2004 2:49 AM
I would also add that you would want to end the current edit.

me.bindingcontext(dataset,"tablename").endcurrentedit()
MigrationUser 1  Monday, March 15, 2004 2:32 PM

You can use google to search for other answers

Custom Search

More Threads

• Datagridview conditional formatting rows
• Sorting a dataTable by date
• Data Grid View Row State not accurate
• DataGridView - Binding to object & sorting
• Focus a header cell in windows datagrid
• Find the primary key of the table bound to datagrid
• bindingcontext.addnew then set combo.selectedindex will not work
• please help me about update and delete
• Dataset Designer. datatable acting strangely
• How to get the previous row using a Binding Source.