I currently have a DataGridView on a form which I want to use with a DataTable in a DataSet, populated from a SQlite database (using System.Data.SQlite).
So, I have a DataAdapter between the database and DataSet and can set the DataGridView data source directly as the DataTable. This displays fine.
My question is this: Why would I want to use a Binding Source here? Many tutorials have said you can use it or not. But is there any use for it, other than adding an extra step?
Also, if I want the database to be updated when the DataGridView is changed, how can this be done? Is the DataSet automatically updated - so I just need to tell the DataAdapter to update? Or is there where a binding source is useful?
Thanks!
AFAIK,您必须在DataSet
上调用GetChanges
,然后插入/更新/删除记录。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.