Solved

Exception thrown when filling a dataset table

Posted on 2004-08-10
11
358 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now