Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > DirectoryService - Exceptions

Reply
Thread Tools

DirectoryService - Exceptions

 
 
Guest
Posts: n/a
 
      06-20-2005
Hi
Is there a way to find out what COMException is being thrown as a result of
an operation, for example

DirectoryEntry newUser = entry.Children.Add(<newuser_CNname>, "user")

I suppose this one would throw a COMException if a duplicate CNname is
found. But if other operations, coming after this one, would also throw
COMExceptions, then how can I differentiate the COMException thrown by each
operation as the COMException error message doesn't seems to provide
specific information. Do I need to throw ApplicationException in this case?
In order to do that, do I need to define my own class of
ApplicationException?

TIA

--



 
Reply With Quote
 
 
 
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      06-20-2005
Are you saying you want to know what the COM error was or want more details
than what it provides you?

The COMException has an ErrorCode property that you can use to get the exact
error codes, but they aren't much more helpful than the error messages
except for handling them programmatically.

If you want more details about the underlying failure, the only way I know
is to p/invoke ADsGetLastError. I might have a sample somewhere if I look
around.

Throwing an ApplicationException won't help you unless I totally don't
understand what you want to do.

Joe K.

<dl> wrote in message news:...
> Hi
> Is there a way to find out what COMException is being thrown as a result
> of
> an operation, for example
>
> DirectoryEntry newUser = entry.Children.Add(<newuser_CNname>, "user")
>
> I suppose this one would throw a COMException if a duplicate CNname is
> found. But if other operations, coming after this one, would also throw
> COMExceptions, then how can I differentiate the COMException thrown by
> each
> operation as the COMException error message doesn't seems to provide
> specific information. Do I need to throw ApplicationException in this
> case?
> In order to do that, do I need to define my own class of
> ApplicationException?
>
> TIA
>
> --
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADSI... DirectoryService... DataGrid =?Utf-8?B?VGltOjouLg==?= ASP .Net 1 03-31-2005 07:36 AM
DirectoryService Query... Help =?Utf-8?B?VGltOjouLg==?= ASP .Net 5 03-29-2005 09:48 PM
HELP... LDAP/ DirectoryService Guru =?Utf-8?B?VGltOjouLg==?= ASP .Net 0 02-18-2005 10:57 AM
VB DirectoryService Guru... HELP??? =?Utf-8?B?VGltOjouLg==?= ASP .Net 0 02-09-2005 02:27 PM
DirectoryService Problem... =?Utf-8?B?VGltOjouLg==?= ASP .Net 3 02-08-2005 04:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57