十万火急:一个AO的问题,动态链接库 (DLL) 初始化例程失败,请大家给指点下
我下边的程序运行的一直很好,可最近老是出现错误,其中ESRI.ArcObjects.Core为我引用的一个dll,主要用它来实现朝数据库里进行加点,代码和错误提示如下
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ESRI.ArcObjects.Core;
namespace WebApplication1
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(Request.QueryString["x"]!="")
{
try
{
IWorkspaceFactory pWorkspaceFactory;
IFeatureWorkspace pWorkspace;
IFeatureClass pFClass;
string datatable=Request.QueryString["leibie"].Split('-')[0];
string infotable=Request.QueryString["leibie"].Split('-')[1];
pWorkspaceFactory = new AccessWorkspaceFactoryClass();// 此行报错
pWorkspace = (IFeatureWorkspace)pWorkspaceFactory.OpenFromFile(@"E:\renfang\data\tree.mdb",0);
pFClass = pWorkspace.OpenFeatureClass(datatable);
IWorkspaceEdit pWorkspaceEdit;
pWorkspaceEdit = (IWorkspaceEdit)pWorkspace;
pWorkspaceEdit.StartEditing(false);
pWorkspaceEdit.StartEditOperation();
IPoint pPnt;
pPnt = new ESRI.ArcObjects.Core.PointClass();// pPnt.X=float.Parse(Request.QueryString["x"]);
pPnt.Y=float.Parse(Request.QueryString["y"]);
IFeature pFeat;
pFeat = pFClass.CreateFeature();
pFeat.Shape = pPnt;
pFeat.set_Value(2,Request.QueryString["name"]);
pFeat.set_Value(5,Request.QueryString["type"]);
pFeat.set_Value(6,Request.QueryString["leibie"]);
pFeat.Store();
pWorkspaceEdit.StopEditOperation();
pWorkspaceEdit.StopEditing(true);
string bb=Request.QueryString["dataid"];
Label1.Text="加点成功";
}
catch(Exception aaa)
{
Label1.Text=aaa.ToString(); }
}
else
{
Label1.Text="对不起,没有传值";
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
错误如下:
System.IO.FileLoadException: 动态链接库 (DLL) 初始化例程失败。 at WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in e:\renfang\adddata\addpoint.aspx.cs:line 52
大家能给指点一下吗?
十万火急,明天要给老板看的