Strange Ado.net problem

C

Christian

Hi there!

I have an application which communicates alot with a SQL-Server.
It has grids for displaying data and edit-forms for editing data.
I have an AppException handler so I will receive all unhandled
exceptions and ignore them if they aren't important.
But when I edit tables alot, add data and remove data I get the
following exception when I close my app and I isn't caught by my AppExit
handler.

An unhandled exception of type 'System.InvalidOperationException'
occurred in mscorlib.dll

Additional information: LocalDataStoreSlot-lagringen har frigjorts.

The part written in swedish above would roughly translate into:
"LocalDataStoreSlot-Store has been released."

Do anyone know what the problem is.
I use sqldataadapters and commandbuilders.

/Christian
 
M

Mary Chipman

You'll need to step through your code line by line and see what
exactly is triggering the exception.

--Mary
 
C

Christian

Hi!

It isn't possible to step through the code where the exception is fired.
It's sometime after I have called me.close() the exception gets throwed
so it isn't directly one of my lines of code, maybe indirectly but again
I have no idea what the problem might be.
 
M

Mary Chipman

Maybe you're trying to close an object without checking to see if it's
open or not in your exception handler? I don't know why you say it
isn't possible to step through the code on your machine. You are using
try/catch exception handling, right? Put a breakpoint on the first
line of code in your procedure, and slowly step through line by line
until you get bumped into your handler so you can see the line of code
that put you there.

--Mary
 
C

Christian

Hi!

It's impossible because I can't catch this exception in the exception
handler, which is very strange. One would think that all exception
raised from my app that's unhandled would eventually end up there but
this doesn't and it's when I do me.close that triggers it and I haven't
done any extra coding in the forms Dispose method.

The only possibility for a problem when I close my connection and
dispose my adapter is if an exception is raised but not thrown until I
close the application which would be even stranger if that's how some
..NET exception works.

/Christian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top