在VS2010 + Win7 32位下 +DB2v9.1.5
1,// ConnLinkStr = "Provider=IBMDADB2.DB2COPY1;Password=123;Persist Security Info=True;User ID=DB2Admin;Data Source=DWJKK;Location=127.0.0.1:50000;CurrentSchema=DBA;Extended Properties=\"\"";
2, ConnLinkStr = @"Provider=IBMDADB2.1;hostname=127.0.0.1;Data Source=DWJKK;Persist Security Info=True;User ID=DB2Admin;Password=123;CurrentSchema=DBA;";
两者都可以正常连接。
但在 Win7 64 位下,只有 第2种能够正常连接。第一种可能是端口 50000 不能正常安装引起的问题
且不能将32位的工程直接拿过来使用。 拿至64位时,要将 ;Build ->General->PlatForm target 改为X86,