编程语言
首页 > 编程语言> > c#-找不到远程主机“.”错误

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

作者:互联网

尝试连接到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”.

标签:db2,database-connection,c,net
来源: https://codeday.me/bug/20191123/2064808.html