首页上一页 1 下一页尾页 1 条记录 1/1页
C#项目开发全程实录中的错误
发表在C#图书答疑
2010-04-26
是否精华
是
否
版块置顶:
是
否
C#项目开发全程实录中的 方法类定义如这一段
string str_Add = "insert into tb_JhGoodsInfo values( ";
str_Add += "'" + tbGood.strGoodsID + "','" + tbGood.strEmpId + "','" + tbGood.strJhCompName + "',";
str_Add += "'" + tbGood.strDepotName + "','" + tbGood.strGoodsName + "','" + tbGood.strGoodsNum + "',";
str_Add += "'" + tbGood.strGoodsUnit + "'," + tbGood.deGoodsJhPrice + " ," + tbGood.deGoodsSellPrice + " ,";
str_Add += "" + tbGood.deGoodsNeedPrice + "," + tbGood.deGoodsNoPrice + ",'" + tbGood.strGoodsRemark + "',";
str_Add += "'" + tbGood.DaGoodTime + "'," + tbGood.Falg + ")";
getSqlConnection getConnection = new getSqlConnection();
conn = getConnection.GetCon();
cmd = new SqlCommand(str_Add, conn);
每执行到 intFalg = cmd.ExecuteNonQuery();就弹出说 第一行附近有语法错误。。错在哪啊 搞了好久没弄出来
conn.Dispose();
return intFalg;
string str_Add = "insert into tb_JhGoodsInfo values( ";
str_Add += "'" + tbGood.strGoodsID + "','" + tbGood.strEmpId + "','" + tbGood.strJhCompName + "',";
str_Add += "'" + tbGood.strDepotName + "','" + tbGood.strGoodsName + "','" + tbGood.strGoodsNum + "',";
str_Add += "'" + tbGood.strGoodsUnit + "'," + tbGood.deGoodsJhPrice + " ," + tbGood.deGoodsSellPrice + " ,";
str_Add += "" + tbGood.deGoodsNeedPrice + "," + tbGood.deGoodsNoPrice + ",'" + tbGood.strGoodsRemark + "',";
str_Add += "'" + tbGood.DaGoodTime + "'," + tbGood.Falg + ")";
getSqlConnection getConnection = new getSqlConnection();
conn = getConnection.GetCon();
cmd = new SqlCommand(str_Add, conn);
每执行到 intFalg = cmd.ExecuteNonQuery();就弹出说 第一行附近有语法错误。。错在哪啊 搞了好久没弄出来
conn.Dispose();
return intFalg;