Click here to Skip to main content
15,742,357 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to save the datagridview items into the database using csharp

Note it is windows application.

In datagridview design screen as follows;

Name Mobile_No Message

A 9789503250 xxx
B 9840578905 yyy
C 9950412484 zzz
D 9790567890 aaa
E 9978904580 bbb

When i click the save button, the above datagridview records should be saved into the database.

For that how can i do using c sharp.

Please help me.

Narasiman P.

1 solution

I wonder firstly how you have loaded the data in the datagridview. If you've loaded it using the data provider for ole db for example, then any changes you make will be to the dataset you've loaded. you then need to create an sql command to 'action' those changes in the database.

This is a good starter for the code you should look at further. Depends where you're database sits, i.e. Access, SQL server etc as to which you implement.

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900