请我这里有一个严重的问题。当我想在 Visual Studio 中调试我的应用程序时,出现此消息框错误:“序号 133 无法位于动态链接库 LIBPQ.dll 中”。此 dll 属于 PostgreSQL 8.3.8。请注意,我也在使用 ArcSDE 10。之后它在 Visual Studio “无法加载服务器库”中给我以下消息。这是我用于连接到 arcsde 的代码。通常它在我的其他应用程序中之前确实有效。
class sdeConnection
{
IWorkspace m_pWorkSpace;
NpgsqlConnection m_pCnx;
IFeatureWorkspace m_pFeatWorkSpace;
ISqlWorkspace m_pSqlWorkSpace;
string m_version;
// Version of the database to be used for the update data
public sdeConnection()
{
// ArcSDE Connexion
Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.SqlWorkspaceFactory");
IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
// create the connection to the database server
IPropertySet pCnxProp = new PropertySet();
pCnxProp.SetProperty("dbclient", "PostgreSQL");
pCnxProp.SetProperty("serverinstance", "localhost");
pCnxProp.SetProperty("instance", "5432");
pCnxProp.SetProperty("authentication_mode", "DBMS");
pCnxProp.SetProperty("database", "sde");
pCnxProp.SetProperty("user", "sde");
pCnxProp.SetProperty("password", "geoserver");
// Creation of the workspace
m_pWorkSpace = workspaceFactory.Open(pCnxProp, 0); **it gave the second error here (Server library could not be loaded)**
// Npgsql Connextion
m_pCnx = new NpgsqlConnection("server=localhost;port=5432;database=sde;user=sde;pwd=geoserver");
}
}