Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 587459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:12:52+00:00 2026-05-13T15:12:52+00:00

I’ve added to my project a dataset item called : myDataSet.xsd After this, I

  • 0

I’ve added to my project a dataset item called : myDataSet.xsd
After this, I drop tables on myDataSet.xsd file. That’s all okey.
What I want to do is, to build Sql Transaction’s as function on
that dataset, how can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T15:12:52+00:00Added an answer on May 13, 2026 at 3:12 pm

    A DataSet is an in-memory structure – there is no direct relationship to SQL or SqlTransaction.

    I think what you are probably referring to is performing operations on the generated TableAdapter instances using a SQL transaction.

    It’s tricky.

    Sahil Malik has a reasonably complete primer on the subject (yes, it’s really a “subject”). Essentially what it all boils down to is extending the TableAdapter via a partial class with a BeginTransaction method which opens the inner SqlConnection and holds it open and hands you back a SqlTransaction which you then use normally. It’s cumbersome, and you have to do this for every TableAdapter. Alternatively, you can use System.Transactions.TransactionScope, but you have to jump through various hoops in order to avoid a promotion to DTC (distributed transaction).

    I’d encourage you to take a look at the linked article, rather than me copying and pasting the code in here.

    If you have a lot of TableAdapters, or in general need to combine more than one of them in a single transaction, Sahil’s approach isn’t going to scale too well. In the past (when I still used TableAdapters) I used a method similar to Ryan Whitaker’s, which is basically monkey-patching; it uses Reflection for most of the heavy lifting.

    Those two are kind of the definitive resources on making TableAdapter code transactionally-safe. Personally, I just wouldn’t use a typed DataSet at all any more; it’s all but obsolete now that Linq to SQL and EF are around, they are much more powerful, have deferred execution, don’t rely exclusively on in-memory structures, and use a Table Data Gateway + Unit of Work pattern that is very easy to get working with transactions. In my experience, if those do not suffice, usually neither will a DataSet and I have to drop down to bare SqlCommand instances. But if for some reason you absolutely must use a DataSet for data access, one of the two aforementioned methods should be what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.