you try
1)用Response.Write(strCommand)察看你的sql语句是否取出值了?
2)检查你的表zhuce,看password字段类型是否是字符型,还是其它类型?一定与之对应起来。
1)用Response.Write(strCommand)察看你的sql语句是否取出值了?
2)检查你的表zhuce,看password字段类型是否是字符型,还是其它类型?一定与之对应起来。
解决方案 »
- 可更新的首页幻灯片
- 正则替换问题
- 首页调用分类栏目
- 求页面最小化代码
- 高分求助,关于服务器指定目录下文件列表的问题。
- 如何在 web 下拉框 控件数据绑定之前,添加一个空白选项
- 虚拟目录也新建了,项目还是打不开,各位兄台帮我看看是什么错误?
- JS和Jquery的关系
- 一个calendar的小问题
- 多个文件同时下载
- select * from INFORMATION_SCHEMA.PARAMETERS where SPECIFIC_NAME='" +this.ProcedureName+ "' order by ORDINAL_POSITION
- 关于DataGrid列表中,在某一列放一个文本框,当点击文本框就进行编辑,编辑完后能不能按回车键(或失去焦点),就进入后台对当行数据进行
比着这个例子来
如果引用了还出错,可以试试以下方法:
...
using System.Data.SqlClient;
...
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = new SqlConnection(strConnection) ;
myCommand.Connection.Open();
myCommand.CommandType = CommandType.Text;
myCommand.CommandText = "INSERT INTO zhuce (name,realname,password) VALUES ('"+TextBoxzhucename.Text+"','"+TextBoxzhucerealname.Text+"','"+TextBoxzhucepwd.Text+"')";
myCommand.ExecuteNonQuery();
...
OleDbConnection OleConn = new OleDbConnection (strConnection);
OleDbCommand OleComm = new OleDbCommand (strCommand,OleConn);try{
OleConn.Open ();
OleComm.ExecuteNonQuery ();
catch(Exception ex){
Response.Write(ex.Message);
}
finally{
OleConn.Close ();
}
把sql写出来看看,比较一下不就知道了?