MS SQL Server
  Home arrow MS SQL Server arrow Completing Your Own SQL Server Based Data ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Moblin 
JMSL Numerical Library 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MS SQL SERVER

Completing Your Own SQL Server Based Data Access Helper using COM+ and VB.NET
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2006-08-21

    Table of Contents:
  • Completing Your Own SQL Server Based Data Access Helper using COM+ and VB.NET
  • Customizing the COM class a bit
  • Getting a row of data from the database using a single method
  • Adding a few more helper methods
  • Executing SQL statements along with BLOB values
  • Retrieving a BLOB value from the database

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Completing Your Own SQL Server Based Data Access Helper using COM+ and VB.NET


    (Page 1 of 6 )

    This article explains the techniques you need to use when developing COM+ based data access helpers using VB.NET.
    A downloadable file for this article is available here.

    This article is not an introductory article to COM+ or ADO.NET.  If you are very new to COM+, I suggest you to go through a previous article of mine that serves as more of an introduction here

    The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2003 Enterprise Architect with Microsoft SQL Server 2005 Developer Edition on Microsoft Windows Server 2003 Enterprise Edition. Even though I believe that the source code available with this contribution can work with Microsoft Visual Studio.NET 2002, I didn’t really test it in any other environment. I request that you post in the discussion area if you have any problems with execution.

    This article is the second of two parts. You can find the first part here.

    Setting up the COM+ attributes

    For any COM+ applications, you need to set up/configure few of the attributes which would affect your application, together with performance and identity. In our case, the following statements will be necessary to configure the COM+ application:

    <Assembly: ApplicationName("CoreMSSQLDataAccessHelper")>

    <Assembly: ApplicationActivation(ActivationOption.Server)>

    <Assembly: AssemblyKeyFile("../../CoreMSSQLDataAccessHelper.snk")>

    <Assembly: ApplicationAccessControl()>

    The first statement is mainly necessary to provide the name of the application.  You can also understand that the comment written in the code which looks like an “ApplicationName” attribute specifies the name of the COM+ application that will hold assembly components.

    The second statement is mainly necessary to make our COM+ application a server based application. The ApplicationActivation.ActivationOption attribute specifies where the assembly components are loaded on activation. It could be either Library or Server.  The option “Library” makes our application run in the consumer/creator’s process. The option “Server” causes our application to be executed in a separate system process (totally different from the consumer/creator’s process).

    The third statement is mainly necessary to make our COM+ application strongly signed. The key file (or Assembly key file) specifies the name of the strong key that will be used to sign the assembly.  The sink file must be generated using “sn.exe” as follows:

    sn -k CoreMSSQLDataAccessHelper.snk

    Every COM+ application is equipped with its own security features by default.  To work with default security features, the fourth statement is necessary. There exist several options for security. It may be necessary to deal with a few of them based on your application requirements.

    More MS SQL Server Articles
    More By Jagadish Chaterjee


       · hello guys! this is the continuation of my previous article on developing DAL using...
     

    MS SQL SERVER ARTICLES

    - Completing the Introduction to Transact-SQL
    - A Brief Introduction to Transact-SQL
    - Lookups and Blocking Bad Data
    - Field Validation Rules for Blocking Bad Data
    - Using Masks to Block Bad Data
    - Blocking Bad Data
    - Using @@ROWCOUNT and TABLE Variables for Dat...
    - How to Use Variables, IF and CASE in Databas...
    - Creating Important Aspects of Notification S...
    - Working wth Variables in Database Interactio...
    - Delving Deeper into Notification Services
    - Notification Services
    - Building a Multi-table Report with SQL 2005 ...
    - A Secure Way of Building Connection Strings
    - Transferring a Database Using the SSIS Desig...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway