小鲜肉 英语怎么说:寻求asp.net高手一名,解决问题,必有重谢~

来源:百度文库 编辑:高考问答 时间:2024/04/29 17:01:44
private void Button1_Click(object sender, System.EventArgs e)
{
string username,title,content;
username=txtusername.Text.ToString();
title=txttitle.Text.ToString();
content=txtcontent.Text.ToString();
string add="insert into message (username,title,content) Values('"+username+"','"+title+",'"+content+"')";
OleDbCommand da2=new OleDbCommand(add,conn);
da2.Connection.Open();
da2.ExecuteNonQuery();
da2.Connection.Close();
Response.Redirect("WebForm1.aspx");

}

你想问什么?

你的conn OleDbConnection在哪里>???

string add="insert into message ([username],[title],[content]) Values('"+username+"','"+title+",'"+content+"')";