Hi Folks
I've been using LINQ to Entites with the graphical Entity Designer taking care of creating all ORM stuff for my DB.
Thus to use it I have something like the following that runs when my program loads.
VB Code:
Dim myContext As myDataEntities
'...
Try
myContext = New myDataEntites
Catch ex As Exception
MessageBox.Show("Could not talk to DB")
Me.Close()
Exit Sub
End Try
The problem is that if the connection is failing for some reason (e.g. I have no connection to the server the DB is on) it takes quiite a long while for anything at all to happen.
Is there a better way I can confirm access to the DB before trying to create the context? (The DB is on a remote server that may be connected via proxy over ethernet)
I did take a look at the generated code in the myData.Designer.vb from my .edmx, but couldn't really work out where it is that the connection to the DB is actually attempted.
Thanks