OleDbConnection is suitable for connecting any type of database (such as Oracle,sql server,access, etc.) with the namespace: using System.Data.OleDb;. Instead, SqlConnection is designed to connect to a SQL Server (MS SQL) database with the namespace: using System.Data.SqlClient. In the operation of the database, if the use of OleDbConnection, then the operation of the database, such as connection pool will be used to OleDbDataAdapter and Operation command with OleDbCommand, the same in the use of SqlConnection, will use Sqldataadaper and Sqlccommand. In some cases, if you need to manipulate data in a data table specific to a field (for example, to get specific data for a column in a row), OleDbConnection can use Oledbdatareader,sqlconnection to SqlDataReader Reader for data read. Second, for the above two cases, you can also use the connection pool, dataset, datetable of the combination of access to a row of their own to a particular column of specific data. For the above specific methods and properties of use can refer to the MSDN explanation!
Db2connection is dedicated to connecting to the DB2 database, through IBM-provided IBM.data.DB2.DLL, which requires the addition of references, location "assemblies", "Extensions", "IBM." Data.db2 "namespace is using IBM. DATA.DB2; In the operation of the database, if the use of db2connection, then the operation of the database, such as connection pool will be used to Db2dataadapter and Operation command with Db2command.
Standard connection string required by DB2
OleDbConnection SqlConnection db2connection Difference