Reputation: 183
i address u all cause im a bit confused of what the course of action should be in this scenario.
I want to do the following in a application im currently building, i wish to show content from a table in my database on a datagridview i have in my form, and id like the changes made by the user in this datagridview be also made in the table from the database.
now i ve read a few articles about databinding but i am not sure if it works for this scenario, or as how to use it since i ve never used databindings before.
Can this be done with bindings, or should i just check for changes in my datagridview and send those changes to the database?.
Thx in advanced for any answer u can give me, i realy need some guidance in this.
Upvotes: 0
Views: 516
Reputation: 30042
This can be done automatically:
Project > Add New Data source > Select Database > select table(s).
View > other Windows > Data sources.
Go to the Data sources box that shows up > select your table > select DataGridView from the drop-down next to table name > Drag your table to your form's designer.
Now you get exactly what you want, the user can change data in the DataGridView and save the changes to the database with automatically generated binding and (New, Save , Delete ) buttons.
Upvotes: 1