Anirudh Goel
Anirudh Goel

Reputation: 4721

unable to add new row using datagridview using C# in Winforms

i wanted to make a simple data entry application. So i did the following

when i ran the application it showed the existing data, and i was able to add new data by clicking on empty row or edit existing data. But it did not store (commit) the data for me.

After i make the changes i just close the application. I remember doing it some time ago and it used to reflect changes. Do i have to add any code to commit the changes?

Upvotes: 3

Views: 4157

Answers (2)

Marc Gravell
Marc Gravell

Reputation: 1063994

A dataset is (by definition) disconnected. If you want to commit new data / updates / deletes (etc), you are going to have to ask the adapter to save the changes. If you already have a generated adapter, this should be about 1 line of extra code... (Update on the adapter, usually via a save button's Click handler).

Upvotes: 2

Shoban
Shoban

Reputation: 23016

Insert Update Delete using datagrid

Upvotes: 1

Related Questions