string made = Convert.ToString(Session["hyid"]);
string wid = Request.QueryString["id"];
System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection();
cnn.ConnectionString = "server=hlh;database=eoknews;uid=hlh;pwd=houlianhui";
cnn.Open();
string sql = "update hywz set title = '" + title.Text + "' where id= '" + wid + "'";
System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand(sql, cnn);
com.ExecuteNonQuery();
cnn.Close();
string wid = Request.QueryString["id"];
System.Data.SqlClient.SqlConnection cnn = new System.Data.SqlClient.SqlConnection();
cnn.ConnectionString = "server=hlh;database=eoknews;uid=hlh;pwd=houlianhui";
cnn.Open();
string sql = "update hywz set title = '" + title.Text + "' where id= '" + wid + "'";
System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand(sql, cnn);
com.ExecuteNonQuery();
cnn.Close();
出异常了吗?,如果这里出异常 请检查连接
title.Text和wid是否带有'?
这里出错误请处理字符串
这样就知道到底是sql语句的问题还是其他什么原因了