Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?)


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

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:

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


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.