|
-
May 10th, 2012, 10:37 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Coding for two types of back-end database
I'm writing a VB.Net 2008 application that needs to read data from three very old Sybase databases. Because of their age, I'm using an OdbcDataReader for this. However, in about six months one of these databases will be replaced with a SQL Server version as part of an upgrade process. To access this new database, I would tend to use a SqlDataReader.
In order to avoid having to recode when the back-end changes, is there a way that I can use a higher level object with a cheeky bit of polymorphism so that I can choose what type of reader to use at run time (this would be based on a config setting)? Both of these readers inherit from System.Data.Common.DbDataReader, but that's marked as MustInherit.
Any advice would be appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|