You can use DataContext.Connection property, Try to open it , if you get an exception then Log the exception, that will give you some information. DataContext.DatabaseExists
returns true/false but no other information. You can do it like:
try
{
//Check if it is not already open
DataContext.Connection.Open();
}
catch (SqlException sEx)
{
//Log sEx
}
catch (Exception ex)
{
// log ex
}
finally
{
if (DataContext.Connection != null && DataContext.Connection.State == ConnectionState.Open)
{
DataContext.Connection.Close();
}
}