pls help me i am stuck in the project and very hard in here.
when i click on the one checkbox in the row which i have set the TrueValue=P in grid view property it store successfuly.but the FalseValue store as null on database. i want to store the 1 instead of the null or 0 so how can i do. it false value i have set in grid view property it didnt work.here is the image of my grid view.
here is my coding after the image of the grid view which store datafrom grid view into datbase.
here is image of the database store value which i want to store the zero instead of the empty or null in cell.
i just want to get the False value of the checkbox should store in database. thanks. my code for storing the value of the checkbox in the project.
{
foreach (DataGridViewRow iteam in dtgAttandance.Rows)
{
con.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO EmpAttandanceDetail Values('"
+txtAttandID.Text+"','"
+ iteam.Cells[0].Value + "','"
+ iteam.Cells[1].Value + "','"
+ iteam.Cells[2].Value + "','"
+ iteam.Cells[3].Value + "','"
+ iteam.Cells[4].Value + "','"
+ iteam.Cells[5].Value + "','"
+ iteam.Cells[6].Value+ "','"
+ iteam.Cells[7].Value+ "','"
+ iteam.Cells[8].Value+ "')",con);
cmd.ExecuteNonQuery();
con.Close();
}
con.Open();
SqlCommand cmdDetail = new SqlCommand("INSERT INTO EmpAttandance values('" + txtAttandID.Text + "','" + dtAttand.Text + "')", con);
cmdDetail.ExecuteNonQuery();
MessageBox.Show("Attandance Save Successfully");
con.Close();
AttandanceDateVerifier();
}