• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 370
  • Last Modified:

Exception thrown when filling a dataset table


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
ACanadian
Asked:
ACanadian
  • 5
  • 4
  • 2
1 Solution
 
gregasmCommented:
have you seen the stacktrace?

wrap the code in a try catch block and examine the stacktrace.
0
 
ACanadianAuthor Commented:
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
 
gregoryyoungCommented:
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
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.

 
ACanadianAuthor Commented:

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
 
gregasmCommented:
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
 
gregoryyoungCommented:
most likely you cannot fix it unless you are causing it through odd but handled data ....

0
 
ACanadianAuthor Commented:

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
 
ACanadianAuthor Commented:
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
 
gregoryyoungCommented:
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
 
ACanadianAuthor Commented:
really? I just wanted to make sure that I wasn't missing the boat while trying to optimize my app.

Thanks

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now