How update dataset with datagrid view C#
I am a beginner and I have this problem. How can I can update a dataset with datagridview?
I am binding dataset in datagrid. Edit datagrid. At finish I want to update the dataset with datagridview.
I am using Winforms.
Example: I bind dataset in datagridview.
dataGridViewCustomers.DataSource =
_ds.Tables[0];
//edit datagridview
//on th开发者_如何学编程is place I want update dataset with datagrid view
Use this code
this.Validate();
this.yourBindingSource.EndEdit();
this.yourtableAdapterManager.UpdateAll(this.yourDataSet);
I hope this what you need.
精彩评论