高手过招,能者多劳
protected void Button1_Click(object sender, EventArgs e)
{
OleDbConnection myconn = DB.CreateConnection();
myconn.Open();
int newID =Convert.toint32(Request.QueryString[ "ID "]);
string sql = "update news set title= ' " + this.M_Title.Text + " ',auther= ' " + this.M_Auther.Text + " ',contents= ' " + this.M_Contents.Text + " ' where ID= "+newID;
OleDbCommand cmd = new OleDbCommand(sql, myconn);
cmd.ExecuteNonQuery();
myconn.Close();
Response.Redirect( "defnews.aspx ");
}
这个是更新的操作
下面的是删除的操作
protected void Button2_Click(object sender, EventArgs e)
{
OleDbConnection myconn = DB.CreateConnection();
myconn.Open();
int newID =Convert.toint32(Request.QueryString[ "ID "]);
string sql = "delete from news where ID= " + newID;
OleDbCommand cmd = new OleDbCommand(sql, myconn);
cmd.ExecuteNonQuery();
myconn.Close();
Response.Redirect( "defnews.aspx ");
}
用VS2005本身运行就都正常删除更新都可以 用本地的IIS测试就有问题
郁闷……
[解决办法]
应该没有什么区别的,在IIS中出现什么异常?