Ensure Connection String has Been Initialized

batutabunsing

Member
Joined
Mar 3, 2008
Messages
19
Programming Experience
Beginner
Hi all.

I randomly get the error "ConnectionString has not been initialized".

Am very much puzzled why this error pops up unexpectedly.

Is there a surefire way to check whether the connection string has been initialized before passing it to a data access mechanism?

Currently, I have the following checking for the connectionstring:

If IsNothing(ConnectionString) then
' Retrieve the connection string from the web service
Else
If String.IsNullOrEmpty(ConnectionString) then
' Retrieve the connection string from the web service
End If
End If

I think the codes posted above is not enough to actually check whether the connection string has been initialized.

Any advice? Thanks.
 

Latest posts

Back
Top