Solved

Exception thrown when filling a dataset table

Posted on 2004-08-10
11
361 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connection String 16 57
Error in script 11 56
VB: Convert 2 dates to specific format 24 48
RegEx with optional part 4 22
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

770 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