473,473 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# COM Component Issues

Hi all,

At a high level here is what is going on -- I built a C# COM object. I need to call this com object from SQL Server using the sp_OACreate stored procedure in SQL Server. I build the COM object, register it using regasm, but when I try to call it in SQL Server I get the following error message - "0x80070002 Extended Procedure The system cannot find the file specified." I have tried registering the DLL with regsvr32 and that returns the message "fsi.dll was loaded, but the DllRegisterServer entry point was not found. DllRegisterServer may not be exported, or a corrupt version of fsi.dll may be in memory. Consider using PView to detect and remove it." Well I checked PView and there are no fsi.dll in memory. So, what my hopes are that someone has built a COM object in .NET, registered it, and was able to call it using sp_OACreate. Any help or ideas at this point would be greatly appreciated.

Step 1 (C# COM Source Code [compiled with COM Interoptibility set to true]
-----------------------------------------------------
using System;
using System.ComponentModel;
using System.Collections;
using System.Diagnostics;
namespace fsi
{
public class com : System.ComponentModel.Component
{
private System.ComponentModel.Container components = null;
public static void Main()
{

}

public static void Main(string[] args)
{

}

public com(System.ComponentModel.IContainer container)
{
///
/// Required for Windows.Forms Class Composition Designer support
///
container.Add(this);
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}
public com()
{
///
/// Required for Windows.Forms Class Composition Designer support
///
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

public string test()
{
return "Success";
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
Step 2 (Register dll on server with regasm)
- Returns success

Step 3 (Call base stored procedure on server)
------------------------------------------------------
DECLARE @object int
DECLARE @hr int
DECLARE @src varchar(255), @desc varchar(255)
EXEC @hr = sp_OACreate 'fsi.com', @object OUT
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
SELECT hr=convert(varbinary(4),@hr), Source=@src, Description=@desc
RETURN
END
Jul 21 '05 #1
0 1478

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert | last post by:
We have several serviced components written in .NET 1.1. Using Visual Studio, we have an installer project that creates an installer for them. The components are installed properly into the GAC...
0
by: Edward Diener | last post by:
In Borland's VCL it was possible to divide a component into design time and run time DLLs. The design time DLL would only be necessary when the programmer was setting a component's properties or...
0
by: Tormod Hystad | last post by:
Hi fellow bitwrestlers, I have a legacy COM component that performs realtime autentication and authorization against a credit card payment provider. They do not provide a native .Net...
1
by: Peter Rilling | last post by:
I created a COM+ component (ServicedComponent) in .NET. The component has a single method Connect() which returns a reference to a SqlConnection object. This component works fine when the world is...
2
by: Andrew Allen | last post by:
I need to migrate a site from Windows 2000 server running IIS5 to Windows 2003 running IIS6. The site uses extensively MSWC.PermissionChecker to control what links to show to users. The...
3
by: Michel Smit | last post by:
I'm running into another problem with my component. I'm trying to use .NET remoting to avoid complex firewall issues. I have a webserver which is the client machine and a database server which...
1
by: Mike | last post by:
I have an ASP.NET 2.0 web service that runs on IIS and calls a VB6 dll which has been registered with COM+. The web service runs fine on all the servers that it has been installed on. However,...
8
by: =?Utf-8?B?VG9tYXM=?= | last post by:
Hello, I have made a component to use in a form. I have add the component to the tools bar in Visual Studio 2005 to use in more than one project. I want to change the Icon asigned...
5
by: Krice | last post by:
There is a component class inside the host class: class Host { Component *c; .... In some cases Component needs to call the host and I guess the only way is that you pass the host for it:
4
by: =?Utf-8?B?Z3JlZw==?= | last post by:
I am trying to create an instance of a 3rd party COM component, and I'm getting an error. I've opened a ticket with this vendor as well, but I want to approach it from the C# .NET side to make...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.