SDE for SQL Server Direct-attached arcengine access
The connection of data in AE is essentially the way of service connection. The connection code is as follows:
1 Publiciworkspace getworkspace ()2 {3Ipropertyset PropertySet =NewPropertysetclass ();4Propertyset.setproperty ("SERVER","127.0.0.1"); 5Propertyset.setproperty ("INSTANCE","sde:sqlserver:127.0.0.1");6Propertyset.setproperty ("DATABASE","SDE");7Propertyset.setproperty ("USER","SA");8Propertyset.setproperty ("PASSWORD","SA");9Propertyset.setproperty ("VERSION","SDE. DEFAULT"); TenType Factorytype = Type.gettypefromprogid ("esridatasourcesgdb.sdeworkspacefactory"); OneIworkspacefactory workspacefactory =(iworkspacefactory) activator.createinstance (factorytype); A returnWorkspacefactory.open (PropertySet,0); -}
For parameter instance,
SDE Service Status |
Parameter values |
Has started |
"5151" or "SDE", or "sde:sqlserver:127.0.0.1" |
Not started |
"sde:sqlserver:127.0.0.1" |
"Arcengine" AE connection sde_for_sqlserver parameter settings