我用VS2003 c#写一个留言本程序..但想做回复功能的时候..不会怎样读取ID..
我的字段名是Countid..
string id = Request["Countid"];
我用这个语句想读取出来..但运行的时候出现错误..上网找了些资料..好像是说id没有赋值..
String SQL, ConnStr;
string id = Request.ToString["Countid"];
TextBox1.Text = id;
ConnStr = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("db.mdb");
SQL = "update guestbook set Content = Content + '<p><font color=#FF0000>管理员的回复:</font><br><br>"
+ txt_reply.Text + "<font color=#333399></font></p>' where Countid = " + id;
OleDbConnection Conn = new OleDbConnection(ConnStr);
Conn.Open();程序大概就这样..请问问题出在哪呢?!! 请问数据库里的id字段..要用什么语句读写出来呢?
我的字段名是Countid..
string id = Request["Countid"];
我用这个语句想读取出来..但运行的时候出现错误..上网找了些资料..好像是说id没有赋值..
String SQL, ConnStr;
string id = Request.ToString["Countid"];
TextBox1.Text = id;
ConnStr = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("db.mdb");
SQL = "update guestbook set Content = Content + '<p><font color=#FF0000>管理员的回复:</font><br><br>"
+ txt_reply.Text + "<font color=#333399></font></p>' where Countid = " + id;
OleDbConnection Conn = new OleDbConnection(ConnStr);
Conn.Open();程序大概就这样..请问问题出在哪呢?!! 请问数据库里的id字段..要用什么语句读写出来呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货