I’ve been looking for a code in the Internet on how to use transaction in Dataset. A transaction that will work on Strongly Typed Dataset. For several days of searching I did not find the answer that suits my purpose.
Yes, there are a lot of examples on the internet but it works in different ways. What I want is an easy answer with less coding. I was amazed that I came up with an answer through trial and error.
Going back after a long hour of research on the internet on this topic I always found similar answer - to use a transaction or transaction scope. But what probably matters is on how to use this Class. An example would simply do, but none is available (not the one that I am looking for).
By the way, a transaction will allow you to rollback a database that is save previously during runtime until it finds an error. This will prevent data inconsistency just in case the other data will not be saved at the same transaction.
In my example I created an Order’s table with Order Details. This table is connected using a strongly type dataset. Then I have another table called CustomerLedger which is not part of the Dataset.
If you are new to Transaction, first you need to add a Reference to System.Transaction. To learn more please read “How to Add Reference in Visual Studio .NET”
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.