what is the equivalent of "CreateService" in C#?




I am really new to C# so please forgive my ignorance!

I am trying to make an 'embedded custom command' inside a
third party app (using C#) to connect to a GIS database
and return some information on the tables that exist
(using their MetadataService).

The MetadataService is a COM object.. They strongly
recommend using "Application.CreateService" to create any
of their objects (so that it runs in the same memory space
of their Application's exe.

In their VB examples (I can't find a C# example), they
suggest creating a MetadataService object, then using
the "connection" from the database object to "bind to" the
connection property of their "MetadataService" object...
on the line where I attempt to set the connection
property, I am getting the following message:

Property, indexer or event 'Connection' is not supported
by the language; try calling accessor
methods 'GMService._MetadataService.get_Connection()'
or 'GMService._MetadataService.set_Connection(ref object)'

I think this has a lot to do with the "CreateService".
Unfortunately I do not know the syntax (or equivalent)
of "CreateService" in the C# language... if someone can
help, or point me in the direction of some documentation
to read, it would be greatly appreciated!!


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question