private void Button1_Click(object sender, System.EventArgs e)
{     
string stringconn="server=127.0.0.1;uid=sa;pwd=;database=teacher";
SqlConnection conn=new SqlConnection(stringconn);
string strSQL="select password from user where id = '"+textBox1.Text+"'";
SqlDataAdapter sqlDataAdapter= new SqlDataAdapter(strSQL,conn);
DataSet ds = new DataSet();
sqlDataAdapter.Fill(ds,"user"); 
if (ds.Tables["user"].Rows.Count>0)
{
DataRow myDR=ds.Tables["user"].Rows[0];
if (textBox2.Text==myDR["password"].ToString().Trim())
{
Response.Write("<script>window.open('error.htm','main');</script>");}
else Response.Write("<script>window.open('user.aspx','contents');</script>");   }
}为什么链不上数据库
登陆的时候说sa无法登陆iis和sql都采用集成登陆模式如果把pwd后面的密码写了,也无法登陆