[fdo-users] .net and fdo

Robert Fortin robert.fortin at autodesk.com
Tue Dec 2 14:22:40 EST 2008

Hi Matteo!

I think the FDO tool box would enable you to copy shp to sdf . See http://fdotoolbox.googlecode.com/  There is also .NET code there to look into.

But in order to give you a very brief introduction to get going with .NET FDO...

-          In order to start you would generally reference OSGeo.Fdo.dll and OSGeo.Fdo.Common.dll (and then add as you need other ones)

-          You can get the list of available provider from OSGeo.FDO.ClientServices.FeatureAccessManager.GetProviderRegistry()

-          You will need to get the connection manager from

OSGeo.FDO.IconnectionManager mConnMgr=OSGeo.FDO.ClientServices.FeatureAccessManager.GetConnectionManager();

-          Once you know the provider you want to create a connection for, you call CreateConnection on the ConnectionManager for the specific provider named.

OSGeo.FDO.Connections.Iconnection mProvConn = mConnMgr.CreateConnection("OSGeo.SDF.3.3");

-          From the connection, you can get the connection Info object which has the list of connection parameters. This varies depending on the provider.

OSGeo.FDO.Connections.IConnectionInfo connInfo = mProvConn.ConnectionInfo;
OSGeo.FDO.Connections.IConnectionPropertyDictionary connPropDict = connInfo.ConnectionProperties;
connPropDict.SetProperty("File", "myfile");

-          Once you are done setting the connection parameters, open the connection


-          From that point on, you can create commands to described the schema

OSGeo.FDO.Commands.Schema.IDescribeSchema schemaCmd
OSGeo.FDO.Schema.FeatureSchemaCollection schemaCol = schemaCmd.Execute();

o   Or select/update/delete the data or to retrieve the schema.

      OSGeo.FDO.Commands.Feature.ISelect selCmd = (OSGeo.FDO.Commands.Feature.ISelect)(OSGeo.FDO.Commands.Feature.ISelectAggregates)mProvConn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select);
      OSGeo.FDO.Commands.Feature.IReader myReader = selCmd.Execute();
      while (myReader.ReadNext())
         string aStr = myReader.GetString("some_property");

Hope this can get you started.


From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Matteo
Sent: Tuesday, December 02, 2008 1:17 PM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] .net and fdo

Hi all, I would to create an application (vb.net or c#) that convert shp file to sdf 3. I'm new in fdo tecnology and I don't know the basic step for develep with FDO. For example: 1) How dll i must be reference in my .net project? 2) What is the connection string to connect to a shp file? I don't find some examples Regards Matteo
View this message in context: .net and fdo<http://n2.nabble.com/.net-and-fdo-tp1605124p1605124.html>
Sent from the FDO Users mailing list archive<http://n2.nabble.com/FDO-Users-f737950.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20081202/1701ca09/attachment-0001.html

More information about the fdo-users mailing list