INSERT语句中列的数目大于VALUES子句中指定的值的数目.VALUES子句中值的数目必须与INSERT语句中指定的列 10
行171:cmd.CommandText=("insertintoProduct(MarketPrice,DiscountPrice,Amount,LeftQuantit...
行 171: cmd.CommandText =("insert into Product(MarketPrice,DiscountPrice,Amount,LeftQuantity,BrifrInfor,Introduction,Picture,NewDegree,CreateDate,DeliverType,ProductName,ProCate2No,payType,ConsID,ProductState) values(Convert(money,'"+this.tbMarketPrice.Text+"'),Convert(int,'"+this.tbDiscountPrice.Text+"'),Convert(int,'"+this.tbQuantity.Text+"'),Convert(int,'"+this.tbQuantity.Text+"'),'"+this.tbBrifr.Text+"','"+this.tbIntroduction.Text+"','"+this.file.PostedFile.FileName.Substring(fullFileName.LastIndexOf("\\")+1)+"','"+this.rBtnNewDegree.SelectedItem+"','"+DateTime.Now+"','"+this.tbName.Text+"','"+this.lbCategory2.SelectedValue+"','"+this.ddlPayType.SelectedValue+"','"+userID+"','0')");
行 172: cmd.ExecuteNonQuery();
源文件: f:\高校学生个人交易网站1\程序\Src\trade\sell.aspx.cs 行: 172 展开
行 172: cmd.ExecuteNonQuery();
源文件: f:\高校学生个人交易网站1\程序\Src\trade\sell.aspx.cs 行: 172 展开
1个回答
展开全部
你的values后面的各个值之间没有加逗号。
试一下:
string strsql="insert into Students(StuName,RealName,StuSex,StuAge,Degree,StuPwd,SEmail,STel,qq) Values(";
strsql = strsql + "'" + txtName.Text + "',";
strsql = strsql + "'" + txtRealName.Text + "',";
strsql = strsql + "'" + sex.Text + "',";
strsql = strsql + "'" + txtAge.Text + "',";
strsql = strsql + "'" + DropDownList1.Items + "',";
strsql = strsql + ",'" + UserName.Text + "',";
strsql = strsql + "'" + txtEmail.Text + "',";
strsql = strsql + "'" + txtTel.Text + "',";
strsql = strsql + "'" + txtQQ.Text + "')";
打字不易,如满意,望采纳。
试一下:
string strsql="insert into Students(StuName,RealName,StuSex,StuAge,Degree,StuPwd,SEmail,STel,qq) Values(";
strsql = strsql + "'" + txtName.Text + "',";
strsql = strsql + "'" + txtRealName.Text + "',";
strsql = strsql + "'" + sex.Text + "',";
strsql = strsql + "'" + txtAge.Text + "',";
strsql = strsql + "'" + DropDownList1.Items + "',";
strsql = strsql + ",'" + UserName.Text + "',";
strsql = strsql + "'" + txtEmail.Text + "',";
strsql = strsql + "'" + txtTel.Text + "',";
strsql = strsql + "'" + txtQQ.Text + "')";
打字不易,如满意,望采纳。
追问
都有逗号啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询