Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

debug compiled code

Posted on 2004-10-04
9
Medium Priority
?
287 Views
Last Modified: 2008-03-03
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
0
Comment
Question by:trevorhartman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 33

Expert Comment

by:raterus
ID: 12219704
how are you handling the errors?  try/catch code please (especially the catch part) :-)
0
 
LVL 8

Author Comment

by:trevorhartman
ID: 12221607
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...  
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12225340
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.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Author Comment

by:trevorhartman
ID: 12229309
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
0
 
LVL 5

Assisted Solution

by:stumpy1
stumpy1 earned 500 total points
ID: 12236162
Error handling is always good practice! Even if its only very simple error handling.
You say, "there should never be a case where i don't get something back from the database though," this is exactly why you should have error_handling, in case for some god knows reason that 1 instance happens and your application falls over.

Here is a link to MS about custom error handling in ASP.Net
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/customerrors.asp
0
 
LVL 33

Accepted Solution

by:
raterus earned 500 total points
ID: 12236946
For production apps, you usually don't want people seeing the original error message (they don't need to debug YOUR application!)  What I do is throw all the errors up to application_error, which I think email the error to myself, and redirect them to an error page that states an error occurred.  The best use I have of try/catch is when I'm opening a DB connection, doing something (that may break) then closing the connection.  I always make it look like this

try
  conn.open
  'do some db work
catch ex as sqlexception
  throw
finally
  conn.close
end try

with the conn.close being in the finally block, my connections will always be closed, even if an error occurs.

--Michael
0
 
LVL 8

Author Comment

by:trevorhartman
ID: 12245442
how do you throw an error up to the application level?
0
 
LVL 5

Expert Comment

by:stumpy1
ID: 12246995
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
0
 
LVL 8

Author Comment

by:trevorhartman
ID: 12251248
thanks for the links and info guys..

-Trevor
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question