[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Set SQL Transaction on Strongly Type TableAdapter

Posted on 2009-04-05
3
Medium Priority
?
382 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 1500 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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