Loading

Dataset Transaction

Submitted by: 
Visitors have accessed this post 14261 times.


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.

Comments

sir,
gave some idea to edit / update and add new in gridview in vb.net with MSSQL.
not by dataset, programmatically

plz mail on [email protected]

1000000000000000 wish dear Admin...
Release from a long doubt bcs of you...............God May increase your Art..bye

Hi Could you kindly provide the accompanying database

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.