日期:2014-05-17  浏览次数:20418 次

{"将 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类型的。你输入的内容有问题吧