Hopefully someone has experience with this type of error handling.
First off I'm using VS 2005 with the 2.0 fx. I used the designer to
create my data adapters and update methods. What I have is an
application that will right to a database (lets call it production
server). It will modify/insert records based onuser entry. Now if
there is a network/server failure where communication is lost between
the application and production server, then the application should
switch to using a local instance of SQL server running. When
communication is restored, the produciton server will upload the
records from the local instance.
I was going to use the StateChanged event to detected when the
communication is lost and perform the switch to the local instance.
The conneciton I'm using is stored in the Application settings of the
project so when the application runs, I adds the handler for that
connection.
Throughout my code I set the adapters' connection to my connection
object in My.Settings because the connection string will change. When
I do the fill; I do the try-catch-finally, the event never registers.
I thought in ADO.net 2.0, the connection state change event will fire
when the actual status of the connection changes. Am I missing
something? Does the event not even fire if you're using a data
adapter?