How to know if SQLExeception is connection problem

  • Thread starter Thread starter Dan Holmes
  • Start date Start date
D

Dan Holmes

if i have a sqlexception error how can i tell if it was a failure to
connect to the db or a problem with the SQL? I want to handle
connection failures a different way.

dan
 
if i have a sqlexception error how can i tell if it was a failure to
connect to the db or a problem with the SQL? I want to handle
connection failures a different way.

dan

SqlException contains at least one SqlError. SqlError contains a
Number property, identifying the error.

All SqlError numbers and descriptions are in:

select * from master.dbo.sysmessages;


More info in: http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlerror(VS.80).aspx


There may be a way faster than this. Anyone?


hth,

cdj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top