The following code is what I\'ve been using to retrieve user information from a sql database.
string userName = LoginUser.UserName;
strin
Why not just change the statement a bit to see if the DataTable is either null or has no rows:
if(dt != null && dt.Rows.Count > 0)
Also, on a side note, you should look into Parameterized Queries as well rather than building your SQL dynamically. It will reduce the number of attack vectors for attackers trying to compromise your application.