HighTechTalks DotNet Forums  

Why no common data provider base classes?

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Why no common data provider base classes? in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Why no common data provider base classes? - 09-28-2004 , 01:37 PM






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

Reply With Quote
  #2  
Old   
John Saunders
 
Posts: n/a

Default Re: Why no common data provider base classes? - 09-28-2004 , 04:24 PM






"Larry F." <LarryF (AT) drmworld (DOT) com> wrote

Quote:
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?
Take a look at the documentation for IDataAdapter, IDbDataAdapter,
IDbConnection, IDbCommand, etc.

-----
John Saunders




Reply With Quote
  #3  
Old   
Greg Low [MVP]
 
Posts: n/a

Default Re: Why no common data provider base classes? - 09-29-2004 , 06:00 AM



Hi Larry,

It all happens that way next version. Wish it was sooner.

HTH,

--
Greg Low [MVP]
MSDE Manager SQL Tools
www.whitebearconsulting.com

"Larry F." <LarryF (AT) drmworld (DOT) com> wrote

Quote:
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



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.