Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
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

3 Answers 3

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.

share|improve this answer

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

share|improve this answer

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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