Wonder,
The proper way to do this is to create an interface that your COM+ class
implements. Then, you would create the instance as you would normally
(through CreateInstance) and then cast it to the interface.
You shouldn't be making late bound calls like this. Interfaces are an
easy way to prevent you from having to do that. The key is defining the
interface in an assembly separate from the implementation (the
implementation is what is registered).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Wonder" <Wo****@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hi all,
I have two objects in my COM+ that I can't add the references to my
project.
It has to use late binding in C#. For my applications in vb.net, I can
solve
the problem using the code below. However, the late binding should be in
C#.
How can I solve the problem?
Dim o As Object
Dim rs As ADODB.Recordset / databaset
o = CreateObject("Component.Class1")
rs = o.Load("SELECT * FROM Customer")
o = Nothing
How can I apply this code to C#?
Thanks in advance,
Wonder