For example, SqlConnection, OleDbConnection, and OdbcConnection classes are derived from IDbConnection interface. These interfaces are defined in the System.Data namespace. I wish I could discuss this whole but It will take me days to finish the article.Īny way, the point in this article is to show you how you can write a generic class, which can access data by using OLE DB, SQL, and ODBC data providers based on the user selection at runtime.Įach data provider's implements some interfaces. In brief, all data provider classes such as a connection, command, data adapter and data reader are inherited from interfaces. For example, when you access an Access database using OLE DB data provider, it uses native OLE DB provider to access the database, But when you use ODBC data provider to access an Access database, it uses ODBC layer on top of the native layer. The main reason of using different data providers is to maintain the performance and not loose native data provider functionality. Three common data providers are OLE DB, SQL, and ODBC. ADO.NET library provides different types of data providers to work with different data sources.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |