COM+ and
the .NET Framework
Building a COM+
Client using C# and .NET
Note |
To
work with any of these samples, you will need the
following: .........................................Microsoft .NET SDK .........................................Microsoft Visual Studio.NET Beta 2 or higher |
1. Develop the Client.cs Application
Create a regular C# client application. Create the COM+ component when required (as in Line 51) and invoke operations on the component (as in Lines 70 and 81).
Client.cs | ||
|
2. Build the Application
Build the files that make up the Client.
Command Prompt |
C:\MyProjects\Cornucopia\COMplus\BankServer\AccountManager\bin\Debug>csc
/r:Bank.dll /t:exe /out:Client.exe Client.cs Microsoft (R) Visual C# Compiler Version 7.00.9254 [CLR version v1.0.2914] Copyright (C) Microsoft Corp 2000-2001. All rights reserved. warning CS1607: Assembly generation -- Referenced assembly 'Bank' is a localized satellite assembly C:\MyProjects\Cornucopia\COMplus\BankServer\AccountManager\bin\Debug> |
Ignore the warning about the assembly being a satellite assembly.
3. Run the Client
Note:
There is an inherent and 'intentional bug' in the way deletes are handled in the BookKeeper Server. You can only delete records in the order that they were created - i.e., you'd have to delete the latest record first !!! If you do try to delete in any other order, you will not be able to create the next new Account !!! This is because of the way new Primary Keys are generated. For explanation, please look at the BookKeeper::getNextKey() method. I intentionally introduced this bug in the program to demonstrate that even though ADO.NET's DataSet is physically disconnected from the DataBase, it maintains and manages its data internally, and still checks Constraints and behaves very much like a regular database. |
Command Prompt |
C:\MyProjects\Cornucopia\COMplus\BankServer\AccountManager\bin\Debug>Client
create Checking "Athul Raj" 100000 Obtained a reference to the Server Object... Invoking createAccount() now ... Key of new Row is: 10 C:\MyProjects\Cornucopia\COMplus\BankServer\AccountManager\bin\Debug>Client delete 10 Obtained a reference to the Server Object... Invoking deleteAccount() now ... deleteAccount() succeeded... C:\MyProjects\Cornucopia\COMplus\BankServer\AccountManager\bin\Debug> |
COM+ | |
Building a complete COM+ Server component using C# and .NET | |
Building a COM+ Client using C# and .NET |
Download the entire source code as a zip file.
click here to go
to
My
Advanced C#/.NET Tutorial Page...
About the Author... |
Gopalan Suresh Raj is a Software Architect, Developer and an active Author. He has co-authored a number of books including "Professional JMS", "Enterprise Java Computing-Applications and Architecture" and "The Awesome Power of JavaBeans". His expertise spans enterprise component architectures and distributed object computing. Visit him at his Web Cornucopia© site (https://gsraj.tripod.com/) or mail him at gopalan@gmx.net. |
This site was developed and is maintained by Gopalan Suresh Raj This page has been visited times since December 31, 2001. |
Last Updated : Dec 31, '01 |
Copyright (c) 1997-2001, Gopalan Suresh Raj - All rights reserved. Terms of use. |
All products and companies mentioned at this site are trademarks of their respective owners. |