By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

Interpreting an Interop error code using SQL-DMO

P: n/a
I have a VB.Net (1.1) that uses SQL-DMO via COM Interop to create a
linked server. The code throws an exception, as it should, when the
linked server I am trying to create already exists on the server. If I
were coding this directly in ADO.Net, then the excerption thrown would
be a SQLException which I could catch and read the errorcode, which
would tell me that the error is "linked server already exists".
However, the error thrown is a
System.Runtime.InteropServices.COMException with an errorcode of
-2147206476. Is it safe for me to assume that this error code is always
the same for a linked server already existing, or is this just a
generic COMexception error code?

Thanks,
Marcus

Apr 10 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.