Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / January 2006

Tip: Looking for answers? Try searching our database.

Why can't I register a serviced component in the COM+ Catalog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Custance - 25 Jan 2006 20:28 GMT
I am am trying to register my DLL in the COM+ Catalog. To do this I am taking the manual approach and using the regsvcs.exe tool provided with the .net framwork.

However when I regiser the dll it comes back that I have derived classes found in the assembly and won't register, saying that classes must be public, concrete and have a default constructor. Why is this happening? As far as I'm aware I haven't got any derived classes apart from the serviced component which is required. Below is my code for my class:

using System;
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;

namespace StepByStep7_1
{
    public class NorthwindSC : ServicedComponent
   {

       private SqlConnection sqlcnn;
       private SqlDataAdapter sqlda;
       private DataSet ds;

       public NorthwindSC()
       {
           // Create a connection to the
           // Northwind SQL Server database
           sqlcnn = new SqlConnection("data source=(local);initial catalog=Northwind User ID = SAassword = *********");
       }

       // This method executes a SELECT query and
       // returns the results in a DataSet object
       public DataSet ExecuteQuery(string strQuery)
       {
           // Create a SqlDataAdapter object to talk to the database
           sqlda = new SqlDataAdapter(strQuery, sqlcnn);

           // Create a DataSet object to hold the results
           ds = new DataSet();

           // Fill the DataSet object
           sqlda.Fill(ds, "Results");
           return ds;
       }

       // This method updates the database with the changes in a DataSet object
       public int UpdateData(DataSet ds)
       {
               // Update the database and return the result
               SqlCommandBuilder sqlcb = new SqlCommandBuilder(sqlda);
               return sqlda.Update(ds.Tables["Results"]);
       }
   }
}

Many thanks for your help in advance

Paul
Tomas Restrepo (MVP) - 26 Jan 2006 01:56 GMT
Paul,

Are you running the regsvcs.exe tool matching the version of the .NET framework you compiled your assembly against?

IOW, if you compile your assembly with v1.1, then you must use the regsvcs.exe tool from the v1.1 distribution. Otherwise the tool will not find the classes.

Signature

Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/

 I am am trying to register my DLL in the COM+ Catalog. To do this I am taking the manual approach and using the regsvcs.exe tool provided with the .net framwork.

 However when I regiser the dll it comes back that I have derived classes found in the assembly and won't register, saying that classes must be public, concrete and have a default constructor. Why is this happening? As far as I'm aware I haven't got any derived classes apart from the serviced component which is required. Below is my code for my class:

 using System;
 using System.Data;
 using System.Data.SqlClient;
 using System.EnterpriseServices;

 namespace StepByStep7_1
 {
      public class NorthwindSC : ServicedComponent
     {

         private SqlConnection sqlcnn;
         private SqlDataAdapter sqlda;
         private DataSet ds;

         public NorthwindSC()
         {
             // Create a connection to the
             // Northwind SQL Server database
             sqlcnn = new SqlConnection("data source=(local);initial catalog=Northwind User ID = SAassword = *********");
         }

         // This method executes a SELECT query and
         // returns the results in a DataSet object
         public DataSet ExecuteQuery(string strQuery)
         {
             // Create a SqlDataAdapter object to talk to the database
             sqlda = new SqlDataAdapter(strQuery, sqlcnn);

             // Create a DataSet object to hold the results
             ds = new DataSet();

             // Fill the DataSet object
             sqlda.Fill(ds, "Results");
             return ds;
         }

         // This method updates the database with the changes in a DataSet object
         public int UpdateData(DataSet ds)
         {
                 // Update the database and return the result
                 SqlCommandBuilder sqlcb = new SqlCommandBuilder(sqlda);
                 return sqlda.Update(ds.Tables["Results"]);
         }
     }
 }

 Many thanks for your help in advance

 Paul

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.