当前位置: 代码迷 >> ASP.NET >> {"将 varchar 值 'P20120717-001' 转换为数据类型为 smallint 的列时发生语法异常。"}
  详细解决方案

{"将 varchar 值 'P20120717-001' 转换为数据类型为 smallint 的列时发生语法异常。"}

热度:7505   发布时间:2013-02-25 00:00:00.0
{"将 varchar 值 'P20120717-001' 转换为数据类型为 smallint 的列时发生语法错误。"}
fn = "ents_comid, ents_mid,ents_sid, ents_pid, ents_qty, ents_wid,ents_price, ents_amount,ents_discount,ents_present, ents_oth1, ents_rem";
  fdb = "Entry_det";
  string strpre = ((CheckBox)GridViewD.Rows[g].FindControl("CheckBoxpre")).Checked.ToString() == "True" ? "1" : "0";
  freq = getuser.Strcomid + ",11,'" + ((TextBox)FormView1.FindControl("entm_idTextBox")).Text.Trim().ToString() + "'," + (g + 1) + ",'" + ((TextBox)GridViewD.Rows[g].FindControl("TextBox1")).Text + "'," + decimal.Parse(((TextBox)GridViewD.Rows[g].FindControl("TextBox3")).Text) + "," + ((TextBox)GridViewD.Rows[g].FindControl("TextBox4")).Text + "," + ((Label)GridViewD.Rows[g].FindControl("Label4")).Text + "," + ((TextBox)GridViewD.Rows[g].FindControl("TextBox6")).Text + ",'" + strpre + "','" + ((TextBox)GridViewD.Rows[g].FindControl("TextBox9")).Text + "','" + ((TextBox)GridViewD.Rows[g].FindControl("TextBox11")).Text + "'";
  DB_operation.insert_data(fn, fdb, freq);
红色字体部分的错误 怎么修改

------解决方案--------------------------------------------------------
P20120717-001是不能转成smallint类型的。你输入的内容有问题吧
  相关解决方案