[fdo-internals] RE: SQL Server, connection and schema

mdelsinne mdelsinne at gmail.com
Wed Nov 23 08:54:41 EST 2011


Thank you Jackie,

But I managed differently, here is the code:

Class aClass = new Class("CLASSTEST", "");

// Add a id property
DataPropertyDefinition idProp = new DataPropertyDefinition("ID", "");
idProp.DataType = DataType.DataType_Int64;
idProp.IsAutoGenerated = true;
idProp.Nullable = false;
aClass.Properties.Add(idProp);
aClass.IdentityProperties.Add(idProp);
idProp.Dispose();

// etc... properties

IDescribeSchema Ischema =
conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_DescribeSchema)
as IDescribeSchema;
FeatureSchemaCollection schemaCollect = Ischema.Execute();
schemaCollect["dbo"].Classes.Add(aClass);
IApplySchema applySchema  =
(IApplySchema)conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_ApplySchema);
applySchema.FeatureSchema = schemaCollect["dbo"];
applySchema.Execute();

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/SQL-Server-connection-and-schema-tp7021142p7024412.html
Sent from the FDO Internals mailing list archive at Nabble.com.


More information about the fdo-internals mailing list