The following code is what I\'ve been using to retrieve user information from a sql database.
string userName = LoginUser.UserName;
strin
It seems to me using a DataTable and SqlDataAdapter is a little bit too heavy for the task.
You can just use a DataReader here:
SqlCommand command = new SqlCommand(comm, conn);
using (var reader = command.ExecuteQuery())
{
if (reader.Read())
{
//logic
var userName = reader.GetString(0);
var password = reader.GetString(1);
// etc
}
}