"Scale .NET Apps With COM+" by Keith Franklin [Visual Studio Magazine, April 2002]

To utilize the sample code for this article you need to setup the following:

1. I suggest testing these components from a Windows Form application. For them to autoinstall into the GAC and Component Services you need to be logged in as an administrator.
To test with ASP.NET the default account that the ASP.NET Worker Process runs under does not have the authority to install into the GAC or Component Services so authority needs to be given to that account or a new account must be used that has authority.


2. Setup database
SQL Server with Northwind database. 
Change Connection information in components to point to this database.

Need to add a new column to the Employees table called Salary which is "decimal" and give it a default.
Need to add a new column to the Employees table called LastUpdated which is "datetime" and give it a default of GetDate()

Need to add the following stored procedures to database


Create PROCEDURE dbo.ChangeEmployeesSalary
	(
		@Increase decimal		
	)

AS
	Update Employees
	Set Salary = Salary + @Increase
	RETURN 
GO
Create PROCEDURE dbo.GetEmployees
AS
	Select * From Employees
	RETURN
GO
Create PROCEDURE dbo.InsertEmployee
	(
	@LastName nvarchar(20),
	@FirstName nvarchar(10), 
	@Title nvarchar(30),
	@TitleOfCourtesy nvarchar(25), 
	@BirthDate datetime,
	@HireDate datetime,
	@Address nvarchar(60),
	@City nvarchar(15),
	@Region nvarchar(15),
	@PostalCode nvarchar(10),
	@Country nvarchar(15),
	@HomePhone nvarchar(25), 
	@Extension nvarchar(4),
	@ReportsTo int, 
	@PhotoPath nvarchar(255),
	@Salary decimal
	)
AS
	INSERT INTO Employees
	                       (LastName, FirstName, Title, TitleOfCourtesy, BirthDate, HireDate, Address, City, Region, PostalCode, Country, HomePhone, Extension, ReportsTo, 
	                       PhotoPath, Salary)
	 VALUES     (@LastName, @FirstName, @Title, @TitleOfCourtesy, @BirthDate, @HireDate, @Address, @City, @Region, @PostalCode, @Country, @HomePhone, 
	                       @Extension, @ReportsTo, @PhotoPath, @Salary)
	RETURN  
GO
CREATE PROCEDURE dbo.UpdateEmployee
(
	@EmployeeID int,
	@LastName nvarchar(20),
	@FirstName nvarchar(10), 
	@Title nvarchar(30),
	@TitleOfCourtesy nvarchar(25), 
	@BirthDate datetime,
	@HireDate datetime,
	@Address nvarchar(60),
	@City nvarchar(15),
	@Region nvarchar(15),
	@PostalCode nvarchar(10),
	@Country nvarchar(15),
	@HomePhone nvarchar(25), 
	@Extension nvarchar(4),
	@ReportsTo int, 
	@PhotoPath nvarchar(255),
	@Salary decimal
	)
AS
	UPDATE    Employees
	SET              LastName = @LastName, FirstName = @FirstName, Title = @Title, TitleOfCourtesy = @TitleOfCourtesy, BirthDate = @BirthDate, 
	                      HireDate = @HireDate, Address = @Address, City = @City, Region = @Region, PostalCode = @PostalCode, Country = @Country, 
	                      HomePhone = @HomePhone, Extension = @Extension, ReportsTo = @ReportsTo, PhotoPath = @PhotoPath, Salary = @Salary,
	                      LastUpdated = GetDate()
	WHERE     (EmployeeID = @EmployeeID)
	RETURN 
GO
CREATE PROCEDURE dbo.TimeStampLastEmployeeChange

AS
	
	SELECT     MAX(LastUpdated) AS TimeStampLastEmployeeChanged
	FROM         Employees
	RETURN 
GO
