» DB2 .NET Data Provider (DB2Connection) » Microsoft OLEDB provider for DB2 » IBM OLE DB Provider for DB2 » .NET Framework Data Provider for OLE DB (OleDbConnection) » IBM DB2 Driver for ODBC and CLI » .NET Framework Data Provider for ODBC (OdbcConnection)DB2 .NET Data Provider This is a .NET Framework Class Library provided by IBM. The class library is contained in the file IBM.Data.DB2.dll.Coding Add a reference to the assembly IBM.Data.DB2 and include the IBM.Data.DB2 namespace. Instantiate a new DB2Connection connection object. Set the connection string and open the connection.C# code sample using IBM.Data.DB2; DB2Connection myConnection = new DB2Connection(); myConnection.ConnectionString = myConnectionString; myConnection.Open(); //execute queries, etc myConnection.Close();
我也在网上找到方法,可是部署的限制导致使用的不现实。 一是ODBC,二是OLE DB 两种方式都需要引用IBM.Data.DB2;所以要求安装DB2的客户端。500M啊。 我们使用C/S架构的系统,你们觉得要求每个客户端安装DB2的客户端合适吗? 通过ODBC的方式除了安装客户端外,可以安装驱动,好像也要几十M的,而且我也找不到下载来尝试使用。 其实我不大愿意每个客户端安装这些东西。原希望安装了200多M的.net framwork2.0就可以搞定一切了,看来是我太乐观了。 所以,麻烦大家告诉我一个不需要每个客户端安装DB2客户端而访问DB2的解决方法。
然后用ODBC来访问。
» Microsoft OLEDB provider for DB2
» IBM OLE DB Provider for DB2
» .NET Framework Data Provider for OLE DB (OleDbConnection)
» IBM DB2 Driver for ODBC and CLI
» .NET Framework Data Provider for ODBC (OdbcConnection)DB2 .NET Data Provider
This is a .NET Framework Class Library provided by IBM.
The class library is contained in the file IBM.Data.DB2.dll.Coding
Add a reference to the assembly IBM.Data.DB2 and include the IBM.Data.DB2 namespace. Instantiate a new DB2Connection connection object. Set the connection string and open the connection.C# code sample
using IBM.Data.DB2;
DB2Connection myConnection = new DB2Connection();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
myConnection.Close();
一是ODBC,二是OLE DB
两种方式都需要引用IBM.Data.DB2;所以要求安装DB2的客户端。500M啊。
我们使用C/S架构的系统,你们觉得要求每个客户端安装DB2的客户端合适吗?
通过ODBC的方式除了安装客户端外,可以安装驱动,好像也要几十M的,而且我也找不到下载来尝试使用。
其实我不大愿意每个客户端安装这些东西。原希望安装了200多M的.net framwork2.0就可以搞定一切了,看来是我太乐观了。
所以,麻烦大家告诉我一个不需要每个客户端安装DB2客户端而访问DB2的解决方法。