Posts Tagged ‘tableadapter’
The main project I’m working on these days is moving several web sites to Azure. It is something I’ve wanted to be able to try for a while. I’m working with several other agencies on this project and some Microsoft consultants so there is some good guidance along the way.
One of the things I wasn’t aware of until yesterday is that SqlAzure can shut down in the middle of your code trying to access it. Actually, this could happen on any SQL server, but it happens frequently enough under Azure that we need to code for it.
Enter the Transient Conditions Handling Framework.
There has been a lot written about how to use this, and I don’t plan on covering that material yet again. The particular issue we ran up against is that our code uses the standard DataSet/TableAdapter framework that MS gave us long ago.
I recently had the need to implement transaction tracking between two separate databases on two separate servers.
Unfortunately, I could not be sure that DTC was implemented on either server, so using transaction tracking with the TransactionScope wasn’t an option.
I also wanted to be able to wire this in easily to the existing 3-tiered framework we are currently using so that what I ended up with could easily be implemented by other developers in a similar situation.
I received the following question a few days ago:
“I am trying to use three tables from the same dataset in one form that I am creating in vs.net winforms my problem I guess is the setup of it as I can get them all on the form but cant get them to all post to the separate tables when I click save I am using a mysql database with the Mysql connector not the obdc can this even be done?”
Frustrating, isn’t it? .NET makes some things SO easy, and then when it isn’t you figure you must have done something wrong.
The good news is, your problem probably has nothing to do with using mySQL–it is all in how you are using the database stuff in WinForms.
Last Thursday, we looked at how to replace the TableAdapter with our own TableAdapter as a way or eliminating our dependence on Microsoft SQL. The problem with this implementation is that every time you want to switch databases, you’ll need to switch what TableAdapter the code is using.