I want to login with existing userID and password in database.
When I use SQL statement in C#, I use this code
string query = "SELECT * FROM MsUser WHERE Username='"+textBoxUsername.Text+"' and Password='"+textBoxPass.Text+"'";
DataTable dt = con.AdapterQuery(query);
if (dt.Rows.Count>0)
{
MessageBox.Show("Success loging");
}
else
MessageBox.Show("Failed");
But i want to use LINQ, what is the code when using LINQ statement??
You simply read user data for given UserName and Password. In LINQ you can replace this with: