阅读:2000回复:1
ASPNET2.0 + ArcEngine9.2开发中总是提示出现如下问题
<P>ASPNET2.0 + ArcEngine9.2开发中总是提示出现:</P>
<P>[COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.]<BR></P> <P>请问如何解决。</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> pFeatureCursor = pFeatureClass.Update(null,false);//(pQueryFilter, false); <--------------------------<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> pWorkspaceEdit.StopEditing(true); <--------------------------</P> |
|
1楼#
发布于:2009-01-06 21:21
<FONT color=#ff0000>在VS2005中调试能通过,但在IIS5.1中就出现了上述问题,请大虾指点!</FONT>
|
|