当前位置: 代码迷 >> C# >> dataGridView.Rows[i].Cells[3].Value 的值怎么转换为整数进行加法运算
  详细解决方案

dataGridView.Rows[i].Cells[3].Value 的值怎么转换为整数进行加法运算

热度:308   发布时间:2016-05-05 04:06:47.0
dataGridView.Rows[i].Cells[3].Value 的值如何转换为整数进行加法运算

sql = " insert into plankDetail3L (批号,明细号,材料名,高,宽,厚,块数) values('" +
                               strOrderId + "'," +
                              dataGridView3.Rows[i].Cells[1].Value + ",'" +
                              dataGridView3.Rows[i].Cells[2].Value + "'," +
                              Convert.ToInt32(dataGridView3.Rows[i].Cells[3].Value) + intHeight + "," +
                              Convert.ToInt32(dataGridView3.Rows[i].Cells[4].Value) + intWidth + "," +
                              Convert.ToInt32(dataGridView3.Rows[i].Cells[5].Value) + intDeep + "," +

                              Convert.ToInt32(dataGridView3.Rows[i].Cells[6].Value) + ")";
                            OBJcmdUpdate3 = new OleDbCommand(sql, sqlConn);
                            OBJcmdUpdate3.ExecuteNonQuery();


引用
 insert into plankDetail3L (批号,明细号,材料名,高,宽,厚,块数) values('1500401',1,'踢脚板1',00,00,00,0)

------解决思路----------------------
(Convert.ToInt32(dataGridView3.Rows[i].Cells[4].Value) + intWidth)
用括号包含下
  相关解决方案