COM+ Transactions | (Windows Forms Application) |
This document contains the release information for the .NET Framework COM+ Transactions sample. You will find the following sections below:
This sample demonstrates some aspects of COM+ Transactions in a .NET Framework application. The sample retrieves a value from the database, then it allows the user to update the value. After the user specifies a new value and selects AutoCompletePost or Post the sample updates the database. Then the sample checks to see if the value entered is permitted (it must be a number =>0 and <=10). If the value is not permitted, the sample aborts the transaction and otherwise commits. Finally the sample shows what the new value in the database is.
The following bullets briefly describe the technologies used by this sample.
This sample is located in the Technologies\ComponentServices\Transactions subdirectory of the .NET Framework SDK samples directory.
For Example:
C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions
In order to properly build and run this sample, the following steps need to be performed.
Type BuildAll.bat from the command line.
For Example:
C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions>buildall.bat
You'll also need to setup the database yourself when building from Visual Studio 7.
For Example:
C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>osql -E -S (local)\NetSDK -i TxDB.sql
If you're building the sample from Visual Studio 7, you will need to install the TxDemoSvr.dll assembly to the Global Assembly Cache before running the sample. Note: The gacutil.exe program is located in the SDK\v1.1\Bin directory.
For Example:
C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>gacutil -i TxDemoSvr.dll
The sample builds a C# and VB version of the client application and COM+ component. Source code for each language is stored in subdirectories named \CS and \VB. The C# component has 'CS' appended to its name as viewed in the Component Services administrative tool, 'TxDemoServerCS.TxObject'. The VB version is named 'TxDemoServerVB.TxObject'. When working with the sample code, be sure to observe and/or modify the version of the COM+ component that corresponds to the client application you launch.
Review comments in the source code and build.bat files for more information on sample binary creation and registration steps.
In order to run this sample, follow the instructions listed below.
For Example:
C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>txdemo.exe
In order to uninstall this sample, follow the instructions listed below.
For the .Net Framework samples to function properly, your Path, Include, and Lib environment variables must be set correctly. In many cases, the SDK install program updates these environment variables for you. However, if you installed the .Net Framework SDK using Visual Studio .NET, or unselected "register environment variables" during setup, these environment variables will not be updated. You can set the Path, Include and Lib environment variables by running SDKVars.bat, located in the <SDKRoot>\Bin directory. SDKVars.bat must be executed in every command shell.