473,657 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"ExecuteRea der request the command to have a transaction..." error occurring when the reader plainly has one.

I'm using the TableAdapterHel per to set the connection and transaction
properties on all the commands of all my typed table adapters.... I've
checked at the time of the error and all the commands have their
Transaction property set. But I still get this error when I call...

documentTA.Upda te(documentDS.D ocument[0]);

"ExecuteRea der requires the command to have a transaction when the
connection assigned to the command is in a pending local transaction.
The Transaction property of the command has not been initialized."

does the tableadapter update use additional derived commands or
something?

The whole loop below:

foreach (DocumentDataSe t.RequestRow requestRow in documentDS.Requ est)
{
using(SqlConnec tion conn = new
SqlConnection(C onfig.Instance. DatabaseConnect ion))
{
conn.Open();
using (SqlTransaction trans =
conn.BeginTrans action())
{
DocumentDataSet TableAdapters.D ocumentTableAda pter documentTA = new
DocumentDataSet TableAdapters.D ocumentTableAda pter();

DocumentDataSet TableAdapters.R equestTableAdap ter requestTA = new
DocumentDataSet TableAdapters.R equestTableAdap ter();

DocumentDataSet TableAdapters.R equestErrorTabl eAdapter requestErrorTA =
new DocumentDataSet TableAdapters.R equestErrorTabl eAdapter();

TableAdapterHel per.SetTransact ion(requestTA,
trans);

TableAdapterHel per.SetTransact ion(requestErro rTA, trans);
TableAdapterHel per.SetTransact ion(documentTA,
trans);

if (DateTime.Now >
requestRow.Requ estDate.Add(Con fig.Instance.Ha ndshakeTimeoutP eriod.TimeSpan) )
{
requestRow.Requ estStatusID =
(int)RequestSta tus.Error;
CreateRequestEr rorRow(document DS,
requestRow, "CODE_FAILU RE", "MSG_HANDSHAKET IME", requestErrorTA) ;
}
documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
requestRow.Docu mentID);
if
(documentDS.Doc ument[0].IsParentDocume ntIDNull())
{
//is original registration
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
}
else
{
//is subdoc
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
documentTA.Upda te(documentDS.D ocument[0]);

//update parent

documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
documentDS.Docu ment[0].ParentDocument ID);
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ReviewNoti ce;
}

documentTA.Upda te(documentDS.D ocument);
requestTA.Updat e(documentDS.Re quest);

requestErrorTA. Update(document DS.RequestError );
trans.Commit();
}
}
}

Mar 20 '07 #1
2 17863
Martin,

You will have to show the code behind the
TableAdapterHel per.SetTransact ion method. Without that, we can't see how
you are working with the transaction.

Also, have you considered using the TransactionScop e class in the
System.Transact ions namespace?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Martin Z" <ma***********@ gmail.comwrote in message
news:11******** *************@n 76g2000hsh.goog legroups.com...
I'm using the TableAdapterHel per to set the connection and transaction
properties on all the commands of all my typed table adapters.... I've
checked at the time of the error and all the commands have their
Transaction property set. But I still get this error when I call...

documentTA.Upda te(documentDS.D ocument[0]);

"ExecuteRea der requires the command to have a transaction when the
connection assigned to the command is in a pending local transaction.
The Transaction property of the command has not been initialized."

does the tableadapter update use additional derived commands or
something?

The whole loop below:

foreach (DocumentDataSe t.RequestRow requestRow in documentDS.Requ est)
{
using(SqlConnec tion conn = new
SqlConnection(C onfig.Instance. DatabaseConnect ion))
{
conn.Open();
using (SqlTransaction trans =
conn.BeginTrans action())
{
DocumentDataSet TableAdapters.D ocumentTableAda pter documentTA = new
DocumentDataSet TableAdapters.D ocumentTableAda pter();

DocumentDataSet TableAdapters.R equestTableAdap ter requestTA = new
DocumentDataSet TableAdapters.R equestTableAdap ter();

DocumentDataSet TableAdapters.R equestErrorTabl eAdapter requestErrorTA =
new DocumentDataSet TableAdapters.R equestErrorTabl eAdapter();

TableAdapterHel per.SetTransact ion(requestTA,
trans);

TableAdapterHel per.SetTransact ion(requestErro rTA, trans);
TableAdapterHel per.SetTransact ion(documentTA,
trans);

if (DateTime.Now >
requestRow.Requ estDate.Add(Con fig.Instance.Ha ndshakeTimeoutP eriod.TimeSpan) )
{
requestRow.Requ estStatusID =
(int)RequestSta tus.Error;
CreateRequestEr rorRow(document DS,
requestRow, "CODE_FAILU RE", "MSG_HANDSHAKET IME", requestErrorTA) ;
}
documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
requestRow.Docu mentID);
if
(documentDS.Doc ument[0].IsParentDocume ntIDNull())
{
//is original registration
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
}
else
{
//is subdoc
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
documentTA.Upda te(documentDS.D ocument[0]);

//update parent

documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
documentDS.Docu ment[0].ParentDocument ID);
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ReviewNoti ce;
}

documentTA.Upda te(documentDS.D ocument);
requestTA.Updat e(documentDS.Re quest);

requestErrorTA. Update(document DS.RequestError );
trans.Commit();
}
}
}

Mar 20 '07 #2
On Mar 19, 10:51 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
Martin,

You will have to show the code behind the
TableAdapterHel per.SetTransact ion method. Without that, we can't see how
you are working with the transaction.

Also, have you considered using the TransactionScop e class in the
System.Transact ions namespace?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard .caspershouse.c om

"Martin Z" <martin.zar...@ gmail.comwrote in message

news:11******** *************@n 76g2000hsh.goog legroups.com...
I'm using the TableAdapterHel per to set the connection and transaction
properties on all the commands of all my typed table adapters.... I've
checked at the time of the error and all the commands have their
Transaction property set. But I still get this error when I call...
documentTA.Upda te(documentDS.D ocument[0]);
"ExecuteRea der requires the command to have a transaction when the
connection assigned to the command is in a pending local transaction.
The Transaction property of the command has not been initialized."
does the tableadapter update use additional derived commands or
something?
The whole loop below:
foreach (DocumentDataSe t.RequestRow requestRow in documentDS.Requ est)
{
using(SqlConnec tion conn = new
SqlConnection(C onfig.Instance. DatabaseConnect ion))
{
conn.Open();
using (SqlTransaction trans =
conn.BeginTrans action())
{
DocumentDataSet TableAdapters.D ocumentTableAda pter documentTA = new
DocumentDataSet TableAdapters.D ocumentTableAda pter();
DocumentDataSet TableAdapters.R equestTableAdap ter requestTA = new
DocumentDataSet TableAdapters.R equestTableAdap ter();
DocumentDataSet TableAdapters.R equestErrorTabl eAdapter requestErrorTA =
new DocumentDataSet TableAdapters.R equestErrorTabl eAdapter();
TableAdapterHel per.SetTransact ion(requestTA,
trans);
TableAdapterHel per.SetTransact ion(requestErro rTA, trans);
TableAdapterHel per.SetTransact ion(documentTA,
trans);
if (DateTime.Now >
requestRow.Requ estDate.Add(Con fig.Instance.Ha ndshakeTimeoutP eriod.TimeSpan) *)
{
requestRow.Requ estStatusID =
(int)RequestSta tus.Error;
CreateRequestEr rorRow(document DS,
requestRow, "CODE_FAILU RE", "MSG_HANDSHAKET IME", requestErrorTA) ;
}
documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
requestRow.Docu mentID);
if
(documentDS.Doc ument[0].IsParentDocume ntIDNull())
{
//is original registration
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
}
else
{
//is subdoc
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ActionReq;
documentTA.Upda te(documentDS.D ocument[0]);
//update parent
documentTA.Fill ByDocumentID(do cumentDS.Docume nt,
documentDS.Docu ment[0].ParentDocument ID);
documentDS.Docu ment[0].DocumentStatus ID =
(int)DocumentSt atus.ReviewNoti ce;
}
documentTA.Upda te(documentDS.D ocument);
requestTA.Updat e(documentDS.Re quest);
requestErrorTA. Update(document DS.RequestError );
trans.Commit();
}
}
}- Hide quoted text -

- Show quoted text -
Figured it out. The TableAdapterHel per sets all the commands
transactions... but the .Update() command doesn't use an existing
command, it dynamically builds one. This, of course, means that the
transaction is not set on that command. So I'm using manual SQL
statements instead of Update.

I should be using a transaction scope, but the server does not have
the distributed transaction coordinator enabled, and I can't figure
out how to get transaction scopes to work without one.

Mar 21 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
13268
by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space. I have tried "dump transaction tempdb with no_log" right before I run the SQL command. But that doesn't help.
0
2448
by: Tom Dacon | last post by:
"Open .Net Command Window Here" context menu for Windows Explorer: The reg file described below adds a new menu item to Windows Explorer's context menu when you right-click over a folder (or the drive root). The menu item text is "Open .Net Command Window Here". When you click it, it opens a command window positioned at that directory and runs the vsvars32.bat file to set the .Net Framework environment variable settings. This makes it...
1
1726
by: Jean-Marc Blaise | last post by:
Dear all, It seems to me the IY54968 apar (V8.2) does not correct totally the problem: db2start db2 connect to sample db2 get snapshot for db on sample | grep "oldest transaction" ==> What should be the result ? If I am not mistaken, it should be 0, as of version 7, as a "connect
4
5907
by: Julia | last post by:
Hi, I have upload my ASP.NET application to my IIS 6.0 server and whenever i try to get a aspx page i get "The request is not supported. " in return when i try to get a .txt file which is in the same directory of the ASP.NET application it works.
1
6195
by: Trygve Lorentzen | last post by:
Hi, my webservice is running on Win2000 SP4, IIS 5.0 fully patched, connecting to a MySQL database and mainly returning Typed DataSet's from webmethods. After running for a while, generally a few days, the webservice stops responding and the .NET windows app client fails with no informative error message. When I try to run any webmethod from the webservice locally in the browser I first get a "This page cannot be display IE error...
3
3679
by: Loane Sharp | last post by:
Hi there I use the FileStream object to download a zip file over the internet to my local disk. The file downloads successfully, but when I attempt to unzip it, I'm told that the file is in use by another process. This occurs even if I release the object using fs.Close() and fs = Nothing. Please help (my code is given below) Best regards
7
4834
by: EManning | last post by:
Using A2003. I'm receiving this error when returning from a "DoCmd.OpenReport..." statement. I have a tab control with a subform on every tab. The user selects an item from a combobox at the top of the main form which refreshes all the subforms. If this DoCmd statement is not executed, then I don't receive the error. I tried a "DoCmd.OpenQuery..." instead of a report but get the same error. I want the user to be able to...
1
9530
by: =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== | last post by:
I have written a Web Service that works with my test harness written using VS2005. However, a client to the service consistently receives a "Bad Request (Invalid Header Name)" response for each request. He is using another development environment that requires that he create the actual request via multiple calls to a library to construct the request. I have sniffed the traffic from my harness program and the requests look like the...
5
13715
by: workingstiff19 | last post by:
I just want people to click on a link to download a file. I've done it before, but this is a new computer and I must be missing something. (Possibly an Apache configuration setting?) Here is the source for the link that generates the error: <a href="./procedures/ODBC_installation.pdf">ODBC driver installation procedure</a><br /> The permissions on the file and the directory containing it are wide
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.