ACanadian
asked on
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.
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
ASKER
Do you mean the 'Call Stack' tab within Visual Studio .net in debug mode?
I have the code wrapped in a try catch block.
I have the code wrapped in a try catch block.
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) ...
It looks to me like the framework itself is throwing and handling an exception (not a whole lot you can do about that) ...
ASKER
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.
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.
Thanks.
most likely you cannot fix it unless you are causing it through odd but handled data ....
ASKER
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.
}
catch(Exception ex)
{
//Handling code...
}
ASKER
Here is some more information:
A first chance exception of type 'System.ArgumentOutOfRange Exception' occurred in system.windows.forms.dll
Additional information: Specified argument was out of the range of valid values.
A first chance exception of type 'System.ArgumentOutOfRange
Additional information: Specified argument was out of the range of valid values.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
really? I just wanted to make sure that I wasn't missing the boat while trying to optimize my app.
Thanks
Thanks
its one of the trade offs of the framework's huge benfits, you lose a bit of control :(
wrap the code in a try catch block and examine the stacktrace.