Link to home
Start Free TrialLog in
Avatar of trevorhartman
trevorhartmanFlag for United States of America

asked on

debug compiled code

Hi,

I run an online app using classes in a dll that i wrote to execute business logic and data access.  The thing is, whenever there is an error in the code inside the dll, it only shows the error on the line in my aspx that calls the method in the dll.  Is there an easier way to debug, and get the specific error out of the compiled dll?  I realize the original code isn't actually inside the dll, but I'm wondering if any of you experts have a better method of debugging?

Thanks,
Trevor
Avatar of raterus
raterus
Flag of United States of America image

how are you handling the errors?  try/catch code please (especially the catch part) :-)
Avatar of trevorhartman

ASKER

I'm not handling the errors.. there shouldn't be errors in the code that i'm writing, but of course WHILE i'm writing it, I make mistakes and need to debug...  
Avatar of stumpy1
stumpy1

I take from your post that you arent using Visual Studio or some other IDE that allows you interactive debugging?

As raterus suggests you could use try/catch code (you probably should have error-handling code in there anyway).

You could also enable tracing within the application to assist you.
maybe i need to start using visual studio..  i'll use this as another reason to do so, and maybe i'll be able to convince my boss :)

as far as try catch goes, i do things like float.Parse(mySqlParamter.Value.ToString()) and sometimes if i don't get a value back from the db, i'll get an error.  there should never be a case where i don't get something back from the database though, so I shouldn't HAVE to do a try catch, should I?  Is it just good practcice?

Thanks,

Trevor
SOLUTION
Avatar of stumpy1
stumpy1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how do you throw an error up to the application level?
Here is a MS link with example code about throwing exceptions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconthrowingexceptions.asp

If you dont have error handling then the error will automatically filter up to the next level. If there isnt eny error handling to catch the error then the error is thrown to the browser.

Heres another MS link about Handling and Throwing Exceptions
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconHandlingThrowingExceptions.asp
thanks for the links and info guys..

-Trevor