c# - 找不到远程主机 "."错误

标签 c# .net db2 database-connection

我在尝试连接到 DB2 数据库时遇到以下错误。

SQL1336N The remote host "." was not found. SQLSTATE=08001

DB2 Express 安装在我的本地机器上,我使用命令窗口在数据库中创建了一些表。

克服此错误的主机名应该是什么?

代码

   string connectionString= @"Provider = IBMDADB2; Database = MYDATABASE; Hostname = .; Protocol = TCPIP; Port = 50000; Uid = xxx123; Pwd = dddd@454";
   OleDbConnection myConnection = new OleDbConnection();
   myConnection.ConnectionString = connectionString;
   myConnection.Open();

最佳答案

也许您应该尝试将您的主机名设置为您的本地 ip 或“localhost”。

关于c# - 找不到远程主机 "."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17481507/

相关文章:

java - DB2 SQL 错误 : -803 when inserting into two related tables

c# - 在安装程序中从 .NET 代码升级 sqlite 数据库的标准做法是什么

sql - 我可以连接来自 2 个不同 DB2 数据库的数据吗? (如 SQL Server 链接数据库)

c# - ASP.Net 中的 Cookie

.net - C# 中的 System.Data.DbType 枚举中的 Oracle Ref Cursor 类型等价物是什么?

c# - 是否可以在 C# 中为泛型创建 "this type"?

.net - Visual Studio 中的 MSTest 项目 : which files to commit to version control?

sql - 如何在 DB2 SQL 中打印出 SQLHSTMT 变量的值?

c# - WSE012 : The input was not a valid SOAP message because the following information is missing: action

c# - Mono.Addin 实现不检索插件