|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
TransactionScope ErrorI wrap two updates from different tableadapters in a transactionscope. They
are connected to the same databese. By runing the program I get an error message: Communication with the underlying transaction manager has failed. Error HRESULT E_FAIL has been returned from a call to a COM component. The code: using (TransactionScope scope = new TransactionScope()) { coworkerTableAdapter.Update(this.userDataSet.Coworker[k]); projectTableAdapter.Update(this.userDataSet.Project[t]); scope.Complete(); } What can be the reason? If I update only one table it works without problems. On Nov 28, 3:53 pm, tim <t***@discussions.microsoft.com> wrote:
Show quote > I wrap two updates from different tableadapters in a transactionscope. They Hi tim,> are connected to the same databese. By runing the program I get an error > message: Communication with the underlying transaction manager has failed. > Error HRESULT E_FAIL has been returned from a call to a COM component. > > The code: > using (TransactionScope scope = new TransactionScope()) > { > > coworkerTableAdapter.Update(this.userDataSet.Coworker[k]); > > projectTableAdapter.Update(this.userDataSet.Project[t]); > scope.Complete(); > } > What can be the reason? > If I update only one table it works without problems. Do you have access to the database server ? I mean to say, check whether MSDTC is enabled on database server machine and on your machine too. It is accessible through following path -- Control Panel --> Administrative Tools --> Component Services --> Component Services --> Computers Now right click on My Computer and click on properties. Go to MSDTC tab. Click Security Configuration Now you just check all check boxes leaving the Enable XA Transactions. Leave everything else as it is. I hope that this works for you. I had a similar problem, which was solved by enabling MSDTC on server and my machine. In case of any problems, please revert back. Thanks, coolCoder ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ If you find this post helpful, please rate it. Hi coolCoder,
Thanks for the answer. MS DTC was enabled and configured like described by MSDN. By updating of one table it works all right. The error appears by updating two or more tables in the database. tim Show quote "coolCoder" wrote: > On Nov 28, 3:53 pm, tim <t***@discussions.microsoft.com> wrote: > > I wrap two updates from different tableadapters in a transactionscope. They > > are connected to the same databese. By runing the program I get an error > > message: Communication with the underlying transaction manager has failed. > > Error HRESULT E_FAIL has been returned from a call to a COM component. > > > > The code: > > using (TransactionScope scope = new TransactionScope()) > > { > > > > coworkerTableAdapter.Update(this.userDataSet.Coworker[k]); > > > > projectTableAdapter.Update(this.userDataSet.Project[t]); > > scope.Complete(); > > } > > What can be the reason? > > If I update only one table it works without problems. > > Hi tim, > Do you have access to the database server ? I mean to say, > check whether MSDTC is enabled on database server machine and on your > machine too. > > It is accessible through following path -- > > Control Panel --> Administrative Tools --> Component > Services --> Component Services --> Computers > Now right click on My Computer and click on properties. Go > to MSDTC tab. Click Security Configuration > > Now you just check all check boxes leaving the Enable XA > Transactions. Leave everything else as it is. > > I hope that this works for you. I had a similar problem, > which was solved by enabling MSDTC on server and my machine. > > In case of any problems, please revert back. > > > Thanks, > coolCoder > > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > If you find this post helpful, please rate it. >
Other interesting topics
|
|||||||||||||||||||||||