阅读背景:

老是出现String or binary data would be truncated.烦死了!!

来源:互联网 

 SqlCommand sc = new SqlCommand("insert into zz_Products(PName,Category,Subcategory,Keywords,Description,FileName,Img_s,Img_b,PContent,Recommend,Hide,AddTime,Stock_id) values('" + PName.Text.ToString() + "'," + Int32.Parse(DropDownList_Category.SelectedValue.ToString()) + "," + Int32.Parse(DropDownList_Subcategory.SelectedValue.ToString()) + ",'" + KeyWords.Text.ToString() + "','" + Description.Text.ToString() + "','" + FileName.Text.ToString() + "','" + Img_s.Text.ToString() + "','" + Img_b.Text.ToString() + "','" + Editor1.Text.Replace("'", "''") + "'," + Convert.ToInt16(Recommend.Checked ? 1 : 0) + "," + Convert.ToInt16(Hide.Checked ? 1 : 0) + ",'" + DateTime.Now.ToShortDateString() + "'," + HiddenField1.Value + ")", conn);  SqlCommand sc = new SqlCommand("insert into z



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: