我每次运行我的代码时都遇到问题..继承我的代码:
SqlConnection con = new SqlConnection("DataSource=SQLSERVER;Bar_login; Integrated Security = True");
DataTable dt = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter("select * from Bar_login where username = '" + txtuser.Text + "' and password ='" + txtpass.Text + "' ", con);
sda.Fill(dt);
if (dt.Rows.Count == 1)
{
MessageBox.Show("Login Succesfully");
}
else
{
MessageBox.Show("Wrong Username and Password");
}
Run Code Online (Sandbox Code Playgroud)
它成功运行但在登录过程之后..这是一个例外
unhandled .."System.ArgumentException:'不支持关键字:'datasource'.'".
有人可以帮忙吗?
我有一个名为tblHello的表,我想把它重命名为Hello