![]() ![]() _ = value Īs you can see, the property assigns the given transaction to the Transaction property on all its commands. Instead of a BeginTransaction method, I have implemented a Transaction property on my TableAdapters, like this: partial class CategoriesTableAdapter That works well, but if you have more than one, you need some way to share a transaction across all your adapters. In his post, he talks about creating a BeginTransaction method on that TableAdapter. Sahil has written a bit about how to do this if you just have the one TableAdapter. Luckily it's possible to implement it yourself using. Support for transactions is not built in to the generated TableAdapter classes. ![]() ![]() When the client program sends the changes in the DataSet back to the server, I want to update the tables, but I want to do it in a transaction so that if any one thing fails, no changes are written to the database. Strange, I know, but I learned how to do database access using raw ADO.NET back in the 1.1 days, and never really bothered with the nice visual DataSet designers or the new TableAdapter helpers.Īnyway, I have a project here with a DataSet containing four tables (and hence four TableAdapter classes). I've recently been using typed DataSets to talk to a database for the first time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |