Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //open conn
- SqlConnection myConnection = new SqlConnection("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\\dbUser.mdf;Integrated Security=True");
- myConnection.Open();
- //command Sql ดึงเฉพาะที่ใช้
- //SELECT * FROM tbUser WHERE Username= 'PhetAdmin' and Password='456789'
- SqlCommand myCommand = new SqlCommand("SELECT * FROM tbUser WHERE Username= 'PhetAdmin' and Password='456789", myConnection);
- SqlDataReader myDatareader = myCommand.ExecuteReader();
- //3
- myDatareader.Read();
- //close conn
- myConnection.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement