for (int i = 0; i <dgv_Data2.Rows.Count-1; i++)
{
string InStocksNum=dgv_Data2.Rows[i].Cells["数量"].Value.ToString();
string InStocksName = dgv_Data2.Rows[i].Cells["货料编号"].Value.ToString();
string InStockSql = "UPDATE MIS_MaterielRegiser set MR_Total=MR_Total+1 where MR_Number=" + InStocksName;
OleDbCommand command = new OleDbCommand(InStocksName,ocnn);
int s = command.ExecuteNonQuery();
}