开发者

How update dataset with datagrid view C#

开发者 https://www.devze.com 2022-12-24 13:53 出处:网络
I am a beginner and I have this problem. How can I can update a dataset with datagridview? I am binding dataset in datagrid.

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

精彩评论

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

关注公众号