I would like to display "No profile found" message, if the UserId doesn't exist in the database. How can i implement it. The code below does not work.
UserId = Request.QueryString["UserId"];
var db = Database.Open("mystring");
var selectCommand = "SELECT * FROM UserProfile WHERE UserId = @0";
var row = db.QuerySingle(selectCommand, UserId);
if (row != null)
{
Email = row.Email;
fullname = row.fullname;
about = row.about;
}else{
ModelState.AddFormError("No Profile Found.");
}