Is it possible to do this task using C#?
Global Const COMPLUS_SERVER As String = "http://myserver"
Sub Test()
Set objRDS = CreateObject("RDS.Dataspace")
Set objCLS = objRDS.CreateObject("MY_System", COMPLUS_SERVER)
Set ListNames = objCLS.LstOBSReasons("databaseserver", "databasename", 5)
End Sub
I've tried with Activator.CreateInstance(Type.GetTypeFromProgID(""));
with no success, besides I would like to know in another way that I can connect to my business object.
Thanks in advance!
It should be possible, first you need to add the Microsoft Remote Data Services Library
to your project's references. You will find it under the COM tab. You can then create the RDS.DataSpace class by doing:
DataSpaceClass objRDS = new RDS.DataSpaceClass();
dynamic objCLS = objRDS.CreateObject("MY_System", "http://myserver");
dynamic listNames = objCLS.LstOBSReasons("databaseserver", "databasename", 5);
The only tricky part is you might not be able to call the resulting object through the dynamic invocation (and I assume you are using C#4). If you can't you will need to also import the types for your business object. For example look at something like this for more information on implementing COM interop.