Arcengine connects to SDE data

Source: Internet
Author: User

Systems developed for arcengine will connect to the spatial database. Here we record the link methods and processes.

Directly run the Code:

// Use the connection property to create propertyset ipropertyset propertyset = new propertysetclass (); propertyset. setproperty ("server", "cuillin"); propertyset. setproperty ("instance", "esri_sde"); propertyset. setproperty ("user", "Scott"); propertyset. setproperty ("password", "Tiger"); propertyset. setproperty ("version", "SDE. default "); propertyset. setproperty ("authentication_mode", "DBMS"); // create an SDE workspace factory and open the workspace // type factorytype = type. gettypefromprogid ("esrisponcesgdb. sdeworkspacefactory "); // var workspacefactory = (iworkspacefactory) activator. createinstance (factorytype); iworkspacefactory workspacefactory = new sdeworkspacefactory (); iworkspace workspace = workspacefactory. open (propertyset, 0 );

In this example, you need to set the user, password, database, server, instance, version, historical_name, historical_timestamp, and authentication_mode. Of course, some attributes can be omitted.

The following is a brief description of the data.

"Server"-name of the SDE service to be connected

"Instance"-instance to be connected

"Database"-name of the connected database

"User"-connection username

"Password"-password of the linked user

"Authentication_mode"-connection credential Authentication mode. It can be set to "OSA" and "DBMS"

"Version"-connect to the transaction version. You can set a string to describe the transaction version name.

"Historical_name"-connect to a previous version. Set a value of the string type, which is the name of a previous version.

"Historical_timestamp"-creates a version connection for a historical event point. The parameter indicates the date and time of the historical timestamp.

Note:

1. The "Database" parameter is optional, but this parameter must be set if multiple databases (such as SQL Server) exist.

2. If the "authentication_mode" parameter is set to "OSA", the "user" and "password" parameters do not need to be set. "OSA" indicates System Identity Authentication. the user's operating system creden establish a database link.

3. a workspace link can be connected to only one version. There are only three attribute parameters ("version", "historical_name", and "historical_timestamp") available.

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.