|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Manual Transactions and RemotingMy application is written in VB.NET and has a data access layer that resides on a different server and is accessed via Remoting. Currently, when performing an update to the database, I pass the SQL string and connection string to the data access layer like so: DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", "data source=MyDBServer; initial catalog=...") However, what I would like to do (but tried and failed) is something like this (from the client): Try DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", ConnObj, TransactionObj) DataAccessLayerClass.RunSQL("UPDATE MyTable2 SET Column3 = "bb", ConnObj, TransactionObj) TransactionObj.Commit Catch TransactionObj.Rollback End Try Any help on how to do this (or an alternative solution) using Remoting would be appreciated. Ryan,
The way you want it is in my idea impossible. The object is living at the client and the only thing you have is the address of it on that in the managed heap of the client. An option to try can be to serialize it on the client and to deserialize it on the server, but by that you are probably sending much more data than you do now and is the horse behind the car. Another system can be to create a dictionary with connectionobjects on your server and play with that. Just my thoughts, Cor Show quoteHide quote "Ryan H" <rherr***@smci.com> schreef in bericht news:O%239P4JOsGHA.5044@TK2MSFTNGP05.phx.gbl... > Hi, > > My application is written in VB.NET and has a data access layer that > resides on a different server and is accessed via Remoting. > > Currently, when performing an update to the database, I pass the SQL > string and connection string to the data access layer like so: > DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", "data > source=MyDBServer; initial catalog=...") > > However, what I would like to do (but tried and failed) is something like > this (from the client): > > Try > DataAccessLayerClass.RunSQL("UPDATE MyTable SET Column3 = "aa", ConnObj, > TransactionObj) > DataAccessLayerClass.RunSQL("UPDATE MyTable2 SET Column3 = "bb", ConnObj, > TransactionObj) > TransactionObj.Commit > Catch > TransactionObj.Rollback > End Try > > Any help on how to do this (or an alternative solution) using Remoting > would be appreciated. > > > >
VB Code question
At least one object must implement IComparable How to create multiple threads? What is an assembly? Compiling VB (.NET) files located in different directories Parsing Files with Regular Expressions Suppressing redraw of PictureBox after moving? Anyone can help me?£¬How to Convert C# to VB.NET, about Flood Fill Can WinCE & Pocket PC support the "AsyncCallback"? DataGridTableStyle |
|||||||||||||||||||||||