Solved

Set SQL Transaction on Strongly Type TableAdapter

Posted on 2009-04-05
3
375 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Expert Comment

by:djon2003
ID: 24074485
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
ID: 24075158
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
ID: 31566862
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

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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