各位大哥:小弟又碰到新问题。SQLServer不能接收到TextBox里的中文的值。 Because your parameter is int type and your textbox give it string typeYou must convert it to int just like convert.ToInt16(txtbox.text) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有没有在web.config里设置<globalization requestEncoding="gb2312" responseEncoding="gb2312" /> 第一位大哥,convert需要的名字空间我不知道。你在看看我的“更新程序“怎么更新不了。(可以运行)万分感谢!!……String strSQL="update grade set 学号=@SNO"+"姓名=@SName,GRE=@SGRE where 学号=@SNO"; SqlCommand cm=new SqlCommand(strSQL,Conn); cm.Parameters.Add(new SqlParameter("@SName",SqlDbType.NVarChar,50)); cm.Parameters.Add(new SqlParameter("@SGRE",SqlDbType.BigInt)); String colvalue=((TextBox)E.Item.Cells[3].Controls[0]).Text; cm.Parameters["@SName"].Value=colvalue; colvalue=((TextBox)E.Item.Cells[4].Controls[0]).Text; cm.Parameters["@SGRE"].Value=colvalue; cm.Parameters.Add(new SqlParameter("@SNO",SqlDbType.BigInt)); cm.Parameters["@SNO"].Value=myGrade.DataKeys[(int)E.Item.ItemIndex]…… sql语句加 ' 试试. String strSQL="update grade set 学号=@SNO,姓名=@SName,GRE=@SGRE where 学号=@SNO"; //姓名前加","; gridview绑定数据库中的图片 [ALL]网站挂马高分求正则!~ 点击提交怎样设置鼠标等待? 请问如何编写文件下载 ~~~用c#写的dll。怎么加密或者混淆比较好?。。~~~ 用session实现网页的访问权限的机制是什么?、 为了感谢大家的支持, 发布我的4个控件(源码), 请大家请教请教 高手请指点,开发DataGrid控件扩展 求助一个正则表达式 初学者问题之五:为什么我连接ado.net时出错,是不是还要安装?急! 错误:“strSize.IndexOf”不存在 大家如何解决datagrid的效率问题?
<globalization requestEncoding="gb2312" responseEncoding="gb2312" />
……
String strSQL="update grade set 学号=@SNO"+"姓名=@SName,GRE=@SGRE where 学号=@SNO";
SqlCommand cm=new SqlCommand(strSQL,Conn);
cm.Parameters.Add(new SqlParameter("@SName",SqlDbType.NVarChar,50));
cm.Parameters.Add(new SqlParameter("@SGRE",SqlDbType.BigInt));
String colvalue=((TextBox)E.Item.Cells[3].Controls[0]).Text;
cm.Parameters["@SName"].Value=colvalue;
colvalue=((TextBox)E.Item.Cells[4].Controls[0]).Text;
cm.Parameters["@SGRE"].Value=colvalue;
cm.Parameters.Add(new SqlParameter("@SNO",SqlDbType.BigInt));
cm.Parameters["@SNO"].Value=myGrade.DataKeys[(int)E.Item.ItemIndex]
……