既然是varcharstring bianhao = (TextBox)e.Item.Cells[2].Controls[0]).Text;
这样就OK了,
Int32.Parse是把它显式转为int类型
这样就OK了,
Int32.Parse是把它显式转为int类型
解决方案 »
- 我想 修改数据库内容 可是总是修改不了 求指教
- asp.net读取IE的历史访问网页记录(IE的临时文件)
- 请教ASP.NET中的OleDbTransaction
- NickLee.Framework2005在线演示地址
- 装 系统时未能安装 IIS 怎么办??? (100分)
- gridview验证问题
- 求助:ASP.NET中在WEB.CONFIG中如何写连接SYBASE数据库的连接字符串?
- 请问有没有工作日志的源代码??
- TreeView的问题
- 希望大家帮帮忙看看:一个update的问题(点update会显示指定的转换无效)
- 一个关于SqlCommandBuilder中二进制数据更新的问题
- 如何判断一个文本框的内容是否为有效年份
string bookname =e.Item.Cell[1].Text;
string bianhao = (TextBox)e.Item.Cells[2].Controls[0]).Text;
string cbs= (TextBox)e.Item.Cells[2].Controls[0]).Text;string jieshao= (TextBox)e.Item.Cells[2].Controls[0]).Text;
string strUpdate ="Update book Set
bianhao="+bianhao+", cbs="+cbs+",jieshao="+jieshao+" where bookname='"+bookname+"'"; 常数中有换行符源错误: 行 55: string jieshao= (TextBox)e.Item.Cells[2].Controls[0]).Text;
行 56:
行 57: string strUpdate ="Update book Set
行 58: bianhao="+bianhao+", cbs="+cbs+",jieshao="+jieshao+" where bookname='"+bookname+"'";
行 59: SqlCommand myComm=new SqlCommand(strUpdate,myComm);
行 58: bianhao="+bianhao+", cbs="+cbs+",jieshao="+jieshao+" where bookname='"+bookname+"'";应该为: string strUpdate ="Update book Set bianhao ='" + bianhao + "',cbs ='" +
cbs + "',jieshao = '" + jieshao + "' where bookname='" + bookname + "'";
string bookname =e.Item.Cell[1].Text;
string bianhao = (TextBox)e.Item.Cells[2].Controls[0].Text;
string cbs= (TextBox)e.Item.Cells[2].Controls[0].Text;
string jieshao= (TextBox)e.Item.Cells[2].Controls[0].Text;string strUpdate ="Update book Set
bianhao='"+bianhao+"', cbs='"+cbs+"',jieshao='"+jieshao+"' where bookname='"+bookname+"'";
SqlCommand myComm=new SqlCommand(strUpdate,myComm);行 54: string jieshao= (TextBox)e.Item.Cells[2].Controls[0].Text;
行 55:
行 56: string strUpdate ="Update book Set
行 57: bianhao='"+bianhao+"', cbs='"+cbs+"',jieshao='"+jieshao+"' where bookname='"+bookname+"'";
行 58: SqlCommand myComm=new SqlCommand(strUpdate,myComm);
行 57: bianhao='"+bianhao+"', cbs='"+cbs+"',jieshao='"+jieshao+"' where bookname='"+bookname+"'";上面两行没有连接符,改一下或是把它放在一行吧:
行 56: string strUpdate ="Update book Set "+
行 57: "bianhao='"+bianhao+"', cbs='"+cbs+"',jieshao='"+jieshao+"' where bookname='"+bookname+"'";