I have a datagridview filled with a table of my database in my winforms Application.
Then I want to save datagridview to my database when I make changes to datagridview. I'm using sql Database.
Here is my code:
DataTable allData = new DataTable();
SqlCommand cmd = new SqlCommand("Select * from contactTable", Connection);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
But nothing happens with this code.
At last I used insert statrements to enter the dataGridView to my database.
Edited 15-Aug-12 8:43am
May be you can investigate about RowEditEnded event.
Hope it helps.
Could u explain a little More and what u want to achive and paste u r whole grid design and u r procedure and the out put var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)