嗨我有 3 列的网格视图我想检查第 2 列和第 3 列是否为空显示消息说在执行保存代码之前但我不能这样做这是我要保存的代码
//second part
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
condatabase.Open();
string Query1 = "insert into mal_makbodatsandok_det (ERADID,ERADTYPENAME,BAYAN,MONY) values('"+txtID.Text+"','" + this.dataGridView1.Rows[i].Cells[1].Value + "','" + this.dataGridView1.Rows[i].Cells[2].Value + "','" + this.dataGridView1.Rows[i].Cells[3].Value + "') ;";
SqlCommand cmddatabase = new SqlCommand(Query1, condatabase);
myreader = cmddatabase.ExecuteReader();
while (myreader.Read())
{
}
condatabase.Close();
}
MessageBox.Show("saved");
请有人告诉我如何在保存前检查