G
Guest
I'm building a lot of ASPX pages and business objects that consume and
interact with database data. Some of this is done with data-binding, some is
done with programmatic calls to Stored Procedures, Views, etc.
I've created a DB class that I use to simplify and make consistent my
inteaction with the database, and for all of the aspects of connecting to the
database, building the call (query, Stored Procedure, Stored Procedure with
Parameters, etc.) that works just fine.
But here's my problem: Data that is returned comes back in objects like
XXDataReader (OleDbDataReader or SqlDataReader). If I use one of these in my
..aspx Pages, it means I've committed to using either OleDb for my database
access of SqlClient for my database access. What if I don't want to have to
decide? What if I want to set things up so that, if I want to switch from a
SqlServer to some other database backend, I can just change my DB class, but
not have to touch all of my pages and other objects?
What's the most elegant and prefered way to do this? I know that I *could*
just use OleDb for everything (including SqlServer), but that seems like such
a shame in that I understand that the SqlClient access for SqlServer is
supposed to be *way* more efficient.
Alex
interact with database data. Some of this is done with data-binding, some is
done with programmatic calls to Stored Procedures, Views, etc.
I've created a DB class that I use to simplify and make consistent my
inteaction with the database, and for all of the aspects of connecting to the
database, building the call (query, Stored Procedure, Stored Procedure with
Parameters, etc.) that works just fine.
But here's my problem: Data that is returned comes back in objects like
XXDataReader (OleDbDataReader or SqlDataReader). If I use one of these in my
..aspx Pages, it means I've committed to using either OleDb for my database
access of SqlClient for my database access. What if I don't want to have to
decide? What if I want to set things up so that, if I want to switch from a
SqlServer to some other database backend, I can just change my DB class, but
not have to touch all of my pages and other objects?
What's the most elegant and prefered way to do this? I know that I *could*
just use OleDb for everything (including SqlServer), but that seems like such
a shame in that I understand that the SqlClient access for SqlServer is
supposed to be *way* more efficient.
Alex