こんにちは、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");
保存する前に確認する方法を誰か教えてください