I added a DBML file with the appropriate connection string and valid credentials. I logged of my VPN hosting the SQL server and I wanted to test my WCF service in terms of what errors would be raised if it could not find the DB.
public List<Users> GetName(strinng UserEmail)
{
var dbResult = from u in Users
where u.email.Equals(UserEmail)
select {v.Firstname, v.LastName, v.Zip};
//Build List<Users>
return List<users>;
}
Say the above is one of my methods. Upon invoking the method with no access to my DB, I did not see any error being thrown.How do I check if the connection is valid and that the DB exists?
I assumed that the DBML.cs file would have ensured this check in the cstor