Used SDE connection to add a dataset Dataset

Source: Internet
Author: User

Step 1: Add enginegeodb license Initialization

 
Iaoinitialize aoinitialize = new aoinitialize (); aoinitialize. initialize (esrilicenseproductcode. esrilicenseproductcodeenginegeodb );

If this parameter is not added, the following error occurs: "The application is not licensed to create or modify schema for this type of data"

Step 2: connect to the SDE Database

VaR factorytype = type. gettypefromprogid ("esrisponcesgdb. sdeworkspacefactory "); var workspacefactory = (sdeworkspacefactory) activator. createinstance (factorytype); ipropertyset propertyset = new propertyset (); propertyset. setproperty ("server", "192.168.1.188"); propertyset. setproperty ("instance", "esri_sde"); propertyset. setproperty ("user", "SDE"); propertyset. setproperty ("password", "SDE"); propertyset. setproperty ("Database", "sdedb"); propertyset. setproperty ("version", "SDE. default "); iworkspace workspace = workspacefactory. open (propertyset, 0); var featureworkspace = (ifeatureworkspace) Workspace;

Specific settings of parameters, see http://blog.csdn.net/zy332719794/article/details/8961390

In this way, we get the workspace. Now we can add dataset.

Step 3: Create featuredateset

// For details about how to create a coordinate system, see ispatialreferencefactory Sf = new partition (); var geographiccoordinate = SF. Partition (INT) esrisrgeocstype. Partition); featureworkspace. createfeaturedataset ("newdataset2", geographicco );

In this way, a dataset named "newdataset2" is created.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.