zyxgis
路人甲
路人甲
  • 注册日期2004-09-01
  • 发帖数28
  • QQ
  • 铜币122枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2055回复:0

ASPNET2.0 + ArcEngine9.2开发中总是提示出现如下问题

楼主#
更多 发布于:2009-01-06 21:23
<P>ASPNET2.0 + ArcEngine9.2开发中总是提示出现:</P>
<P>[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]</P>
<P><BR>请问如何解决。</P>
<P>相关代码:</P>
<P>LicenseInitializer m_AOLicenseInitializer = new LicenseInitializer();<BR>        m_AOLicenseInitializer.InitializeApplication(<BR>                new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB, esriLicenseProductCode.esriLicenseProductCodeArcInfo },<BR>                new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeVector, esriLicenseExtensionCode.esriLicenseExtensionCodeSchematics, esriLicenseExtensionCode.esriLicenseExtensionCodeArcScan, esriLicenseExtensionCode.esriLicenseExtensionCodeServerStandardEdition, esriLicenseExtensionCode.esriLicenseExtensionCodeServerAdvancedEdition, esriLicenseExtensionCode.esriLicenseExtensionCodeServerEnterprise, esriLicenseExtensionCode.esriLicenseExtensionCodeFoundation, esriLicenseExtensionCode.esriLicenseExtensionCodeNetwork, esriLicenseExtensionCode.esriLicenseExtensionCodeDataInteroperability }<BR>                );<BR>        btm_Click();<BR>        m_AOLicenseInitializer.ShutdownApplication(); </P>
<P>出错位置:</P>
<P>//开始编辑<BR>            pWorkspaceEdit.StartEditing(false);<BR>            pWorkspaceEdit.StartEditOperation();</P>
<P>            //查询出要编辑的要素            <BR>            //pQueryFilter = new QueryFilterClass();<BR>            //pQueryFilter.WhereClause = "1 = 1";<BR>            //pQueryFilter.SubFields = "stcdstr, drp";<BR>            <FONT color=#ff0000>pFeatureCursor = pFeatureClass.Update(null,false);//(pQueryFilter, false);            <--------------------------</FONT><BR>            //pFeatureCursor = pFeatureClass.Search(null, false);<BR>            pFeature = pFeatureCursor.NextFeature();<BR>            pFields = pFeatureCursor.Fields;<BR>            int fieldIndex = pFields.FindField("drp");<BR>            int fieldOIDIndex = pFields.FindField("stcdstr");//该字段与数据库中的STCD字段相对应<BR>            //编辑的要素,修改字段值<BR>            while (pFeature != null)<BR>            {<BR>                string tableFieldValue = "0";//默认数值<BR>                string featureFieldValue = pFeature.get_Value(fieldOIDIndex).ToString().Trim();//<BR>                for (int i = 0; i < dataTable.Rows.Count; i++)<BR>                {<BR>                    if (dataTable.Rows[0].ToString().Trim().Equals(featureFieldValue))<BR>                    {<BR>                        tableFieldValue = dataTable.Rows[1].ToString();<BR>                        if (tableFieldValue == null || tableFieldValue.Length == 0) //如果为空值时<BR>                        {<BR>                            tableFieldValue = "0";//默认数值<BR>                        }<BR>                        break;<BR>                    }<BR>                }<BR>                pFeature.set_Value(fieldIndex, tableFieldValue);<BR>                pFeatureCursor.UpdateFeature(pFeature);<BR>                System.Runtime.InteropServices.Marshal.FinalReleaseComObject(pFeature);<BR>                pFeature = null;<BR>                pFeature = pFeatureCursor.NextFeature();<BR>            }<BR>            pWorkspaceEdit.StopEditOperation();<BR>            <FONT color=#ff0000>pWorkspaceEdit.StopEditing(true);            <--------------------------</FONT></P>

<P><BR><FONT color=#ff0000>在VS2005中调试能通过,但在IIS5.1中就出现了上述问题,请大虾指点!</FONT></P>
喜欢0 评分0
游客

返回顶部