开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜