![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm new to .Net, so I'm sure I'm missing something simple. I was astounded to learn that there is no common data provider class. I had assumed that since SQL, OLEDB, and other supported data providers had so much in common, that their connection, reader, and adapter classes would be derived from the same base classes. In other words, SQLDataReader and OldDBDataReader are so similar, I expected them to both derive from some common virtual class that probably should have been called DataReader. If they had a common base class, I could write most of my code to work with either class. As it now is, all my code that uses data has to explicitly know the type of the data provider. If I want to change my code from SQL to OLE DB, I have to change all my SQLDataReaders to OleDBDataReaders, etc. I've written my own common database classes before that worked fine, so I know it can be done. Help me out here. Why are there no commond data provider classes? Is it because the data providers really don't have much in common? It seems that once the connection has been established, simple database read and writes are very similar between providers. OO programing encourages common functionality to be provided in shared base classes, but that isn't the case with .Net database support. Why not? |
#3
| |||
| |||
|
|
I'm new to .Net, so I'm sure I'm missing something simple. I was astounded to learn that there is no common data provider class. I had assumed that since SQL, OLEDB, and other supported data providers had so much in common, that their connection, reader, and adapter classes would be derived from the same base classes. In other words, SQLDataReader and OldDBDataReader are so similar, I expected them to both derive from some common virtual class that probably should have been called DataReader. If they had a common base class, I could write most of my code to work with either class. As it now is, all my code that uses data has to explicitly know the type of the data provider. If I want to change my code from SQL to OLE DB, I have to change all my SQLDataReaders to OleDBDataReaders, etc. I've written my own common database classes before that worked fine, so I know it can be done. Help me out here. Why are there no commond data provider classes? Is it because the data providers really don't have much in common? It seems that once the connection has been established, simple database read and writes are very similar between providers. OO programing encourages common functionality to be provided in shared base classes, but that isn't the case with .Net database support. Why not? Thanks, Larry |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |