Arcgis server:Connection To SDE ORACLE

• Top Print Reply Alert Moderator   
SubjectConnection To SDE ORACLE 
AuthorMourad AbuSall 
DateJun 25, 2007 
Messagei created this code to connect on geodatabase sde and this code not working i don't know why!!.

what i do for this ?
please help me ....
it was stoped on this code :
------------------------
pFact = New SdeWorkspaceFactory
pWorkspace = pFact.Open(pPropSet, Me.HWnd)
------------------------
and display this error :
"Page_Error
Exception from HRESULT: 0x80040228" 
 
Dim pPropSet As IPropertySet
            pPropSet = New ESRI.ArcGIS.esriSystem.PropertySet
            Dim pFact As IWorkspaceFactory
            Dim pWorkspace As ESRI.ArcGIS.Geodatabase.IWorkspace
            With pPropSet
            .SetProperty("Server", "isc-devsrv")
            .SetProperty("Instance", "5151")
            .SetProperty("Database", "")
            .SetProperty("User", "REGIS")
            .SetProperty("password", "REGIS")
            .SetProperty("version", "SDE.DEFAULT")
            End With
            pFact = New ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactory
            pWorkspace = pFact.Open(pPropSet, Me.HWnd)
            Dim pFeatureWorkspace As IFeatureWorkspace
            pFeatureWorkspace = pWorkspace
            Dim pFeatureClass As IFeatureClass
            pFeatureClass = pFeatureWorkspace.OpenFeatureClass("REIS_SDE.RPAR_Real_Estate_Parcels")
            Dim dsenum As IEnumDataset = pWorkspace.getDatasets(ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureDataset)
            Dim ds As IDataset = dsenum.Next()
            While Not (ds Is Nothing)
            MsgBox(ds.Name)
            ds = dsenum.Next()
            End While
            
 
 Mourad AbuSall
GIS Developer

Ideal Solutions Co.

Ahmed Bin Ali Str., Wadi Al Sail West
PO Box 20851, Doha, Qatar
Tel: +974-4888450/2/3
Fax: +974-4888451
Mob: +974-5028350
Email: mabusall@isolc.com
Web: www.isolc.com
 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorJeff Bourdier 
DateJul 11, 2007 
MessageI am having almost this same exact problem. (The only difference is that my error message doesn't say "Page_Error".)

What version of ArcGIS are you using? I'm using 9.2.

The 9.2 documentation on IWorkspaceFactory.Open says to specify an additional property, "AUTHENTICATION_MODE" as either "OSA" or "DBMS". I have specified it as "DBMS" and still get the same error.

Any help on this would be appreciated! 
 
Dim pPropSet As IPropertySet
            Dim pSdeFact As IWorkspaceFactory
            pPropSet = New PropertySet
            With pPropSet
            .SetProperty("SERVER", Server)
            .SetProperty("INSTANCE", Instance)
            .SetProperty("DATABASE", Database)
            .SetProperty("USER", User)
            .SetProperty("PASSWORD", Password)
            .SetProperty("AUTHENTICATION_MODE", "DBMS")
            .SetProperty("VERSION", version)
            End With
            Dim pSDEWorkspace As IWorkspace
            pSdeFact = New SdeWorkspaceFactory
            pSDEWorkspace = pSdeFact.Open(pPropSet, 0)
            
 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorJim Wozniczka 
DateJul 12, 2007 
MessageI am having the exact same problem with 9.2, so you're not alone! 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorMatt McGuire 
DateJul 12, 2007 
MessageI am getting the same error and I'm guessing it is because hWnd is a windows programming construct. I don't think the web server can deal with it.

If that is true, it leaves us the question - how do I connect directly to an SDE database with DotNet and ArcObjects? Can it be done?
 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorJim Wozniczka 
DateJul 16, 2007 
Messagefyi...I've got an incident open with ESRI technical support about this problem. I'll be sure to post if I get a response of some kind.

Jim 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorAndrew Hayden 
DateJul 16, 2007 
MessageHere is some code I cobbled together when I was working on examples of dynamically adding shapefiles and featureclasses (from a button click event). Some of it's commented and some is double commented (there is a shapefile example and my adaptation for an SDE example (vector and raster)). You should pretty much get the idea of what you need to uncomment to get it to work. The code works with SDE Oracle. 
 
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
            '********************************************************************************************************
            'Code for connecting to shapefiles on the server or connecting to SDE
            'Dim mapFunc As ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality = _
            'CType(Map1.GetFunctionality(0), ESRI.ArcGIS.ADF.Web.DataSources.IMS.MapFunctionality)
            'Dim mapView As MapView = mapFunc.MapView
            ''shapefile example
            ''Dim drainWkspc As New ShapeWorkspace("riversWorkspace", "D:\ArcIMS\data\NorthAmerica")
            ''sde example
            ''Dim drainWkspc As New SdeWorkspace("riversWorkspace", "servername", "port:XXXX", "user", "password")
            ''sde raster example
            'Dim drainWkspc As New SdeWorkspace("riversWorkspace", "servername", "port:XXXX", "user", "password")
            ''shapefile example
            ''Dim drainDataset As New FeatureDataset("Rivers", drainWkspc)
            ''sde example
            ''Dim drainDataset As New FeatureDataset("LAND.TFLANDS", drainWkspc)
            ''sde raster example
            'Dim drainDataset As New ImageDataset("SDE_RASTER.CIR2005.RASTER", drainWkspc)
            ''shapefile and sde example
            ''Dim drainLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.FeatureLayer("riversDynamic", drainDataset)
            ''drainLayer.Type = FeatureType.Polygon
            ''sde raster example
            'Dim drainLayer As New ESRI.ArcGIS.ADF.IMS.Carto.Layer.ImageLayer(drainDataset)
            ''shapefile and sde example
            ''Dim drainSymbol As New SimpleLineSymbol(System.Drawing.Color.Blue, 2)
            ''Dim drainRenderer As New SimpleRenderer(drainSymbol)
            ''drainLayer.Renderer = drainRenderer
            ''drainLayer.Name = "TF Lands"
            ''sde raster example
            'drainLayer.Name = "2005 Color IR"
            '' ArcIMS map configuration file (axl) needs 'MAP dynamic="true"' to work
            'mapView.Layers.Add(drainLayer)
            'Map1.InitializeFunctionalities()
            'Map1.Refresh()
            'Toc1.Refresh()
 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorKnut Erik Hollund 
DateJul 19, 2007 
MessageYour code Andrew Hayden, might work ok - but I guess the other problems is not with ArcGIS Server (ADF's) but with the ArcObjects api. (Standalone)

I've got the same issue as well, trying to write a small console utilg and got the error. The same code works ok if i'm doing it within a command class. (A new menu item within ArcMap).

If anybody happens to resolve this, please reply :-)

Pasting my code as well. (c#)
Got Error "Exception from HRESULT: 0x80040228" 
 
//For example, server = "sde-server".
            // Database = "P100.mydomain.no"
            // Instance = "5151".
            // User = "vtest".
            // Password = "go".
            // Version = "SDE.DEFAULT".
            public IWorkspace OpenArcSDEWorkspace(string server, string instance, string user,
            string password, string database, string version)
            {
            ESRI.ArcGIS.esriSystem.IPropertySet propertySet = new ESRI.ArcGIS.esriSystem.PropertySetClass();
            propertySet.SetProperty("SERVER", server);
            propertySet.SetProperty("INSTANCE", instance);
            propertySet.SetProperty("DATABASE", database);
            propertySet.SetProperty("USER", user);
            propertySet.SetProperty("PASSWORD", password);
            propertySet.SetProperty("VERSION", version);
            IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.SdeWorkspaceFactoryClass();
            return workspaceFactory.Open(propertySet,0);
            }
            IWorkspace pWorkspace = OpenArcSDEWorkspace("sde-server", "5151", "myadm", "myadmpassword", "P100.mydomain.com", "SDE.DEFAULT");
 
 --
Knut Erik Hollund
Statoil ASA, Norway 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorKnut Erik Hollund 
DateJul 19, 2007 
MessageOK - so this resolved the issue for me :-)

I had forgot to initialise the Arc - license ! :-/

Used the following code in C# - and whola ! - Connected. 
 
            ESRI.ArcGIS.esriSystem.IAoInitialize a = new ESRI.ArcGIS.esriSystem.AoInitialize();
            a.Initialize(ESRI.ArcGIS.esriSystem.esriLicenseProductCode.esriLicenseProductCodeArcView);
            
 
 --
Knut Erik Hollund
Statoil ASA, Norway 
  
• Top Print Reply Alert Moderator   
SubjectRe: Connection To SDE ORACLE 
AuthorJeff Bourdier 
DateJul 24, 2007 
MessageAs a matter of fact, I've just independently discovered that the same is true in my case. I had not yet initialized ArcObjects.

Funny, in the 9.1 version of this application, it worked without initializing ArcObjects. Apparently this changed in 9.2.

 
 
Private m_pAoInitialize As IAoInitialize
            Private Sub initializeArcObjects()
            m_pAoInitialize = New AoInitialize()
            m_pAoInitialize.Initialize(esriLicenseProductCode.esriLicenseProductCodeArcView)
            End Sub

转载于:https://www.cnblogs.com/gentlewolf/archive/2007/11/12/956999.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值