private void button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C: \Users\mohamma ali\Documents\Visual Studio 2015\Projects\WindowsFormsApplication4\WindowsFormsApplication4\MyLib_DB.mdf ;Integrated Security=True;Connect Timeout=30");
string query = "Select * From User_Registration where UserID = '" + username_textbox.Text.Trim() + "' & Password = '" + password_text.Text.Trim() + "'";
SqlDataAdapter sda = new SqlDataAdapter(query, con);
DataTable dt = new DataTable ();
sda.Fill(dt);
if (dt.Rows.Count == 1)
{
mainmenu main = new mainmenu();
this.Hide();
main.Show();
}
else
{
MessageBox.Show("Please Check usename and password");
}
}
возвращается неожиданная ошибка при sda.fill(dt)
?