我正在将数据从 a 复制DataGridView
到数据库表名 test1,但引发了无效操作异常。我该如何解决?
foreach (DataGridViewRow row in dataGridView2.Rows)
{
string mysqlStatement = "INSERT INTO test1(Paper, Authors, ID, GSCitations)VALUES("+row.Cells[0]+","+row.Cells[1]+","+row.Cells[2]+","+row.Cells[3]+");";
MySqlCommand mysqlCmd = new MySqlCommand(mysqlStatement, connection);
mysqlCmd.ExecuteNonQuery();
}