3

I try to create a geodatabase using some SQL command and then register some tables of it with SDE.

I create an empty geodatabase using sde post installation and then create tables and other database objects in a program written by VC# using command like "Create Table" and other DDL scripts.

but after creating database successfully user of this VC# program has to enter "Command prompt" and type sdelayer command to register tables one by one.

I need to make all the process seamless for user and user must not see any change in working environment.Now my question,is there any way that I register tables of my geodatabse with SDE by VC# code programming instead of using "sdelayer" command in command prompt?(Any object model?)

Regards

  • Did David's answer end up being correct? I'm trying to do the same thing with the Java API, but I'm running into issues. – Chris Jan 25 '12 at 15:47
2

Maybe the IClassSchemaEdit.RegisterAsObjectClass method will help (see the GeoDatabase OMD). You should be able to QI it from an ITable, opened in the usual fashion (e.g. IFeatureWorkspace.OpenTable(in Name: String) since you've already built your GDB).

Excerpt from that method's documentation (italics mine):

The RegisterAsObjectClass method will register a table or feature class (ArcSDE layer) in the database with the Geodatabase. The act of registering the data as an object class will create records for the object class in the Geodatabase system tables and assign the object class a unique ID. Once a table or SDE layer is registered as an object class, it can participate in rules, topological relationships and relationships.

|improve this answer|||||
0

You could call the sdelayer command from C#, see: https://stackoverflow.com/questions/206323/how-to-execute-command-line-in-c-get-std-out-results

|improve this answer|||||
-2

Is this what you're looking for (silent post-install):

sdesetup -o install -d SQLSERVER -s myservername -D mydatabasename -l "X:\PathToLicenseFile\authorization.ecp"

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.