Building a Robust and Highly Scalable Distributed Architecture using VB.NET - How to Test COM Serviced Component
(Page 4 of 6 )
The following are the steps which are to be followed very strictly (we are about to work with projects 1 and 2):
- Create a table named ‘tAreas’ with a single column ‘Area’ of type ‘varchar’ (I am currently using SQL Server 2000).
- Create a stored procedure named ‘pAreaInsert’ with the following code:
CREATE PROCEDURE pAreaInsert
@Area varchar(50)
AS
if exists (select Area from tAreas where Area = @Area)
begin
return 10
end
else
begin
insert into tAreas values (@Area)
end
return 0
- Download the enclosed zip file and extract it
- Open Visual Studio.NET 2003 Command Prompt
- Using the DOS prompt move to the DataAccessComponent\bin folder from the extracted directory (in this case MyTrial\DataAccessComponent\bin)
- Type the following command to place the COM+ serviced component in GAC (Global Assembly Cache):
gacutil /i DataAccessComponent.dll
- Further proceed with the following command to register the component in COM+ services registry:
Regsvcs /fc DataAccessComponent.dll
- Open Programs -> Administration Tools -> Component Services
- Right-click on the component and go to properties as shown in following figure Fig. 2
- Go to Activation tab and change the constructor string according to your requirements (as shown in Fig. 3)
- Now move to MyTrail\ConsoleCOMPlusClient\bin folder using the same command prompt and execute ‘ConsoleCOMPlusClient.exe’, which should return a message ‘Successful’.
- Check your table ‘tAreas’ where a dummy value ‘this is from COM+’ gets inserted just to prove the Serviced Component Functionality.
Huh?! Let us further proceed to test other components.
Next: How to Test Remoting Component Without Using Windows Service >>
More Visual Basic.NET Articles
More By Jagadish Chaterjee