use ADO.NET to connect to DB2.
Provider=DB2OLEDB;Cache Authentication=False;Password=myPassword;Persist
Security Info=True;User ID=myUser;Initial Catalog=BIGBLUE;Network Transport
Library=TCPIP;Host CCSID=37;PC Code Page=1252;Network
Address=111.22.136.23;Network Port=446;Package Collection=QGPL;Default
Schema=QGPL
参考:
http://groups.google.com/groups?q=ado.net+db2&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=ehiLWd%23ECHA.1956%40cpmsftngxa07&rnum=4
Provider=DB2OLEDB;Cache Authentication=False;Password=myPassword;Persist
Security Info=True;User ID=myUser;Initial Catalog=BIGBLUE;Network Transport
Library=TCPIP;Host CCSID=37;PC Code Page=1252;Network
Address=111.22.136.23;Network Port=446;Package Collection=QGPL;Default
Schema=QGPL
参考:
http://groups.google.com/groups?q=ado.net+db2&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=ehiLWd%23ECHA.1956%40cpmsftngxa07&rnum=4
哪些参数是必须要的呀? THANK YOU!!
For TCP/IP connectionsoConn.Open = "Provider=DB2OLEDB;" & _
"Network Transport Library=TCPIP;" & _
"Network Address=xxx.xxx.xxx.xxx;" & _
"Initial Catalog=MyCatalog;" & _
"Package Collection=MyPackageCollection;" & _
"Default Schema=MySchema;" & _
"User ID=MyUsername;" & _
"Password=MyPassword"
For APPC connectionsoConn.Open = "Provider=DB2OLEDB;" & _
"APPC Local LU Alias=MyLocalLUAlias;" & _
"APPC Remote LU Alias=MyRemoteLUAlias;" & _
"Initial Catalog=MyCatalog;" & _
"Package Collection=MyPackageCollection;" & _
"Default Schema=MySchema;" & _
"User ID=MyUsername;" & _
"Password=MyPassword"