string sql = "select * from user where user_name='" +t1.Text.Trim()+ "' and user_password='"+t2.Texstring sql = "select * from user where user_name='" +t1.Text.Trim()+ "' and user_password='"+t2.Text.Trim()+ "'";错在哪里啊?protected void Button1_Click(object sender,EventArgs e){string str="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server .MapPath ("App_Data/user.mdb");OleDbConnection conn = new OleDbConnection(str);conn.Open();string sql = "select * f
string sql = "select * from user where user_name='" +t1.Text.Trim()+ "' and user_password='"+t2.Tex
string sql = "select * from user where user_name='" +t1.Text.Trim()+ "' and user_password='"+t2.Text.Trim()+ "'";错在哪里啊?
protected void Button1_Click(object sender,EventArgs e)
{
string str="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server .MapPath ("App_Data/user.mdb");
OleDbConnection conn = new OleDbConnection(str);
conn.Open();
string sql = "select * from user where user_name='" +t1.Text.Trim()+ "' and user_password='"+t2.Text.Trim()+ "'";
OleDbCommand oledbcommand = new OleDbCommand(sql,conn);
OleDbDataReader rd = oledbcommand.ExecuteReader();
int add=0;
while (rd.Read()) { add++; }
if(add ==0){
Response .Write ("需要进入系统!");}
else
{ Response .Redirect ("index.aspx");
}
请帮小弟看看这段asp.net中的代码,我点登录按钮时总是提示“from子句错误”,
string sql = "select * from [user] where [user_name]='" +t1.Text.Trim()+ "' and [user_password]='"+t2.Text.Trim()+ "'";