Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 10th, 2005, 09:15 AM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Global Connection Object

I have a global connection object called cnText declared public in a module. In one of the forms I am using a transaction object with cnText to perform a certain database transaction. At the end I either commit or rollback. But when I try to use cnText after that elsewhere in the application (this time without any transaction object), it says that I need to initialize another transaction object because cnText is being used in a pending transaction. How do I continue to use cnText without having to close it and open it again?

I tried disposing the transaction object after rollback/commit, but it didn't work.

Thanks,
SM
 
Old May 18th, 2005, 06:00 AM
Authorized User
 
Join Date: May 2004
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Apparently everything is working fine and there shouldn't be any problem. Any way, how's your application working with data? Is it using a DataSet to cache data and update the data source at a later time? If so, try synchronizing the DataSet with the underlying data source after a transaction commit or rollback by using the Update method of the DataAdapter and passing to it your DataSet. May be it helps.

Regards,

ejan





Similar Threads
Thread Thread Starter Forum Replies Last Post
Global ADO Connection to SQL ? debbiecoates VB Databases Basics 2 October 29th, 2007 03:22 AM
How to create a Global Database connection? chrislepingwell ADO.NET 6 November 8th, 2006 07:20 PM
Global SQL Connection tallbry VB Databases Basics 2 November 8th, 2004 10:58 PM
Global SQL connection MichaelTJ .NET Web Services 16 December 16th, 2003 09:34 PM
Global ADO Connection object DaveParry123 ADO.NET 0 October 7th, 2003 03:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.