更新时间:2023-10-15 09:11:22
1)您是否在foreach (DataGridViewRow row in dataGridView1.Rows)
行上设置了断点并逐步执行代码以确保您甚至尝试编写更新超过一排?
2)您应该将查询稍微更改为update customer set Address=@address where Name1=@name
或使用其他列作为行选择器.
1) Have you set a breakpoint on theforeach (DataGridViewRow row in dataGridView1.Rows)
row and stepped through the code to ensure that you are even attempting to write updates for more than one row?
2) You should change your query a bit toupdate customer set Address=@address where Name1=@name
or use a different column as the row selector.