Data reader
I'm trying to match a UserID and Password from existing database using Data Reader and if no match shoe message and validating the information on the return
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Khargesh RajputRank #616 · 3.9K reputationPosted Apr 8, 2015, 7:53 PM EDT
Sample for fetch data is like
SqlCommand command = new SqlCommand(
"SELECT * FROM login where username=@uname and password=@pwd;",
connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
if (reader.HasRows)
{
//login success
}
else
{
//invalid login
}
Akhil GargRank #772 · 3K reputationPosted Apr 8, 2015, 6:47 PM EDT