Shurik Posted November 29, 2003 Posted November 29, 2003 Hi all, I am using a dbProvider (eInfoDesigns) to connect to MySQL database, and while this works fine, I am unable to catch errors. For example, if my host is down, I would like the program to report to me that connection failed, and not crash with.. An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in dbprovider.dll I use MSQL.Open() to open a connection, but don't know how to catch an error. Any advice? :) PS. I am a total n00b when it comes to VB and .net so please explain in layman's terms. Quote
Administrators PlausiblyDamp Posted November 29, 2003 Administrators Posted November 29, 2003 You would need to use a Try ... Catch ... End Try Block Try MSQL.Open 'Other code may go here Catch ex as SocketException 'What to do if it goes wrong End Try Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Shurik Posted November 29, 2003 Author Posted November 29, 2003 Thanks for that. Works perfectly Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.