高手帮我看看这查询语句错在哪!
protected void Button1_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
{
string username = this.TextBox1.Text;
string password = this.TextBox2.Text;
string str="select * from user where username ='" + username + "'";
SqlConnection conn = new SqlConnection("Data Source=localhost;initial Catalog=sjlerp;uid=sa;pwd=****");
SqlCommand com = new SqlCommand(str,conn);
conn.Open();
SqlDataReader rea = com.ExecuteReader();
}
}
}
运行的红色的位置的时候总提示'user'附近有语法错误