Solved

Exception thrown when filling a dataset table

Posted on 2004-08-10
11
363 Views
Last Modified: 2011-09-20

H Gurus,

I am attempting to optimize my application.  I found a great article through Experts Exchange and it talks about how expensive exceptions are to your application. Especially the ones you don't know about.  So I followed its points on how to identify those hidden exceptions using Perfmon and the debugger.  It seems that every time I fill a datatable from a data adapter an exception is being thrown.

eg:

daOrderCategories.Fill(ds.tblOrderCategories_SelectAll);
Generates Exception: "Specified argument was out of the range of valid values."

I am wondering what the cause of this could be, because these exceptions are not breaking the application. Just slowing it down.

Any thoughts?

ACanadian
0
Comment
Question by:ACanadian
  • 5
  • 4
  • 2
11 Comments
 
LVL 8

Expert Comment

by:gregasm
ID: 11764848
have you seen the stacktrace?

wrap the code in a try catch block and examine the stacktrace.
0
 

Author Comment

by:ACanadian
ID: 11764937
Do you mean the 'Call Stack' tab within Visual Studio .net in debug mode?

I have the code wrapped in a try catch block.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11765108
intresting ... its happenning internally being handled and continuing ... can you put up your full code maybe one of your arguments is causing it ?

It looks to me like the framework itself is throwing and handling an exception (not a whole lot you can do about that) ...

0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:ACanadian
ID: 11765229

Yes I thinks that is whats happening, I was just wondering if there is a way I can fix that.  

I want to minimize the number of exceptions being thrown. My own and ones the occurr within the framework.
0
 
LVL 8

Expert Comment

by:gregasm
ID: 11765547
Call the code, and then catch the exception. Print the contents of the exception object's stacktrace property. Would you paste the stacktrace here?

Thanks.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11767052
most likely you cannot fix it unless you are causing it through odd but handled data ....

0
 

Author Comment

by:ACanadian
ID: 11768518

How can I catch the exception if it is being handled by the frame work.

Here is what my method looks like

try
{

daOrderCategories.Fill(ds.tblOrderCategories_SelectAll);

}
catch(Exception ex)
{
   //Handling code...
}
0
 

Author Comment

by:ACanadian
ID: 11768536
Here is some more information:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in system.windows.forms.dll

Additional information: Specified argument was out of the range of valid values.
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 125 total points
ID: 11769122
I wouldnt worry about it, there is precisely nothing you will be able to do about it ...

Try running IsDate in vb and see what happens :)
0
 

Author Comment

by:ACanadian
ID: 11769642
really? I just wanted to make sure that I wasn't missing the boat while trying to optimize my app.

Thanks

0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 11769998
its one of the trade offs of the framework's huge benfits, you lose a bit of control :(
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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