我有一个抛出错误的C#代码:
SqlConnection sq = new SqlConnection(@"C:\USERS\USER\DOCUMENTS\VISUAL STUDIO 2012\PROJECTS\LOGINAPP\DB\LOGINDB.MDF");
string q = "Select * from Table where textBox1= '" + textBox1.Text.Trim() + "'and Password'" + textBox2.Text.Trim() + "'";
SqlDataAdapter s = new SqlDataAdapter(q, sq);
DataTable d = new DataTable();
s.Fill(d);
if (d.Rows.Count == 1)
{
frmMain G = new frmMain();
this.Hide();
G.Show();
}
else
{
MessageBox.Show("Check your Username or Password or both");
}