连接到 SQL 任何地方 - dblgen12.dll 未找到

Connect to SQL Anywhere - dblgen12.dll not found

我尝试使用 iAnywhere.Data.SQLAnywhere.v4.0.dll.

连接到 SQL Anywhere 12 数据库

在数据库服务器上,此连接成功,但在任何其他 PC 上我收到错误 Language Ressourcefile not found<dblgde12.dll, dblgen12.dll>

此处为原始(德语)错误消息,不幸的是,即使在我的英语系统上,错误消息也是德语。

我在sql服务器的安装目录下找到了这些文件,但我不知道如何处理它们,因为我无法在gac中安装它们。

连接:

iAnywhere.Data.SQLAnywhere.SAConnection connection = new SAConnection();
connection.ConnectionString = new SAConnectionStringBuilder(){  DatabaseName = "123", UserID = "123", Password =
                    "123", ServerName = "123" , Host = "10.11.11.10"}.ConnectionString;
connection.Open();

谢谢

再问 google 一段时间后,我发现有人问了以下问题: http://sqlanywhere-forum.sap.com/questions/19449/cannot-find-the-language-resource-file-dblgen12dll

已接受的答案链接到 http://dcx.sybase.com/index.html#1201/en/dbadmin/da-install-s-5107108.html,其中解释了 dll 查找文件的位置。

On Windows, SQL Anywhere searches the following paths relative to each location in the preceding list:

.

..

.\bin32 and ..\bin32 (32-bit programs only)

.\bin64 and ..\bin64 (64-bit programs only)

.\java (for Java-related files)

..\java (for Java-related files)

.\scripts (for SQL script files)

..\scripts (for SQL script files)

可以在这里找到必要的文件http://dcx.sybase.com/index.html#1201/en/dbprogramming/deploying-adonet-deploy.html

所有这些文件都可以在以下目录中的 SQL Anywhere Installation 12 中找到:C:\Program Files\Sybase\SQL Anywhere 12

额外信息

您需要将 dblgde12.dlldblgen12.dll 放入项目文件夹 \bin\debug

至于连接字符串,我正在使用这个。

SAConnection conn = new SAConnection("ENG=LXDBSRV;DBN=database;UID=username;PWD=password;POOLING =FALSE;LINKS=tcpip{Host=PC-g};CS=utf-8");

其他方式是:

SAConnection conn = new SAConnection("DSN=LXSYDSN;UID=username;PWD=password;DBF=c:\LxOffice.db");