Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi
i have problem to add value checkbox in datagridview to database sql server and type of data filed (bit) in database

C#
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
               {


 cmd.CommandText = "insert into acountment (done,partial,donot)values (Boolean.Parse(dataGridView1.Rows[i].Cells[11].Value.ToString()) + "', '" + Boolean.Parse(dataGridView1.Rows[i].Cells[12].Value.ToString()) + "', '" + Boolean.Parse(dataGridView1.Rows[i].Cells[13].Value.ToString()) + "')";
                   cnn.Open();
                   cmd.ExecuteNonQuery();

                   cnn.Close();

               }
Posted
Updated 29-Mar-15 4:38am
v2

1 solution

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