我有一个数据网格视图我想将数据从数据网格视图复制到数据库表,它会引发 mysql 异常,请帮助这是我的代码
foreach (DataGridViewRow row in dataGridView2.Rows)
{
if (row.Cells[0].Value != null) //if id is not null
{
string mysqlStatement = "INSERT INTO test1(Paper, Authors, ID, GSCitations) VALUES('" + row.Cells[0].Value + "','" + row.Cells[1].Value + "','" + row.Cells[2].Value + "','" + row.Cells[3].Value + "');";
MySqlCommand mysqlCmd = new MySqlCommand(mysqlStatement, connection);
mysqlCmd.ExecuteNonQuery();
}
}
不正确的整数值:第 1 行的“ID”列的“分组可验证内容选择性披露”是错误的