Solved

Set SQL Transaction on Strongly Type TableAdapter

Posted on 2009-04-05
3
365 Views
Last Modified: 2013-12-17
Strongly typed table adapters do not expose select, insert or delete commands.  How can you attach a SQL transaction?
0
Comment
Question by:wadepart
3 Comments
 
LVL 9

Expert Comment

by:djon2003
Comment Utility
How about :
SqlCommand myCmd = new SqlCommand();

myCmd.Connection = CURCONN;

myCmd.CommandText = "BEGIN TRANSACTION";

myCmd.ExecuteNonQuery();

Open in new window

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
Comment Utility
Here is a work around
http://www.codeproject.com/KB/dotnet/transactionta.aspx

On this page
http://www.pcreview.co.uk/forums/thread-1899482.php
check out the comment from zebadiah81

You can add queries to the tableadapter. Here is a sample. Scroll a bit to see the add query example

http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspx

0
 

Author Closing Comment

by:wadepart
Comment Utility
Codeproject link was a good solution for creating a new class for tableadapters.  In the end went with solution from link below to create a new function using same reflection to set transaction on adapter. http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework.adonet/topic61572.aspx
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now