Solved

Exception thrown when filling a dataset table

Posted on 2004-08-10
11
364 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
[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
  • 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
Industry Leaders: 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!

 

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

Technology Partners: 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!

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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