I have a datagridviwer populated by a sql database query, in that datagrid I have a column with a chekbox, now comes my doubt, how do I write to the database when the row has been selected by the user in the chekbox.
codetodaywhereIinsertitintothebankbutwithoutrunningthechekbox
privatevoidncheklist(){SqlCommandcmd=newSqlCommand();cmd.CommandType=CommandType.Text;cmd.CommandText=@"INSERT INTO TBL_CHEKLIST (N_NOTA, CLIENTE, TRANSP, VOLUME, N_CHEKLIST, EMISSAO)
VALUES (@NOTA, @CLIENTE, @TRANSP, @VOLUME, @CHEKLIST, @EMISSAO)";
cmd.Connection = conex1;
conex1.Open();
cmd.Parameters.Add(new SqlParameter("@NOTA", this.txt_nota.Text));
cmd.Parameters.Add(new SqlParameter("@CLIENTE", this.txt_cliente.Text));
cmd.Parameters.Add(new SqlParameter("@TRANSP", this.txt_transp.Text));
cmd.Parameters.Add(new SqlParameter("@VOLUME", this.txt_volume.Text));
cmd.Parameters.Add(new SqlParameter("@CHEKLIST", this.txt_nchklist.Text));
cmd.Parameters.Add(new SqlParameter("@EMISSAO", Convert.ToDateTime(txt_dtinicial.Text).ToString("yyyy/MM/dd").Replace("/", "")));
cmd.ExecuteNonQuery();
conex1.Close();
}