Re: OleDb vs. Sql Interoperability
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Mon, 21 Aug 2006 07:23:46 +0200
Alex,
Maybe this sample can help you although it looks probably very difficult as
this is your first expirience with AdoNet.
Cor
"Alex Maghen" <AlexMaghen@xxxxxxxxxxxxxxxx> schreef in bericht
news:E7F84D60-43F3-4685-8253-462F1B0296F3@xxxxxxxxxxxxxxxx
Cor -
Thanks for this. I'll admit I don't really understand the Factory concept.
I'll look into it further. One question I *do* have though - it seems like
I
could always return a DataTable object from all of the data objects and
functions I've created instead of returning OleDbDataReaders or
SqlDataReaders. This way, all of my binding, etc. could remain the same
even
if I were to choose to switch between Sql and OleDb, right?
Is this a bad idea? It says in the documentation that a XXXDataReader
object
is more effidient than a DataTable.
Thoughts?
Alex
"Cor Ligthert [MVP]" wrote:
Alex,
This should do what you need, although it is not yet complete in my
opinion.
http://msdn2.microsoft.com/en-us/library/system.data.common.dbproviderfactory.aspx
I hope this helps,
Cor
"Alex Maghen" <AlexMaghen@xxxxxxxxxxxxxxxx> schreef in bericht
news:EE0F0CD2-F333-450B-BC13-AD6D22FF11B0@xxxxxxxxxxxxxxxx
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
.
- Follow-Ups:
- Re: OleDb vs. Sql Interoperability
- From: Cor Ligthert [MVP]
- Re: OleDb vs. Sql Interoperability
- References:
- Re: OleDb vs. Sql Interoperability
- From: Cor Ligthert [MVP]
- Re: OleDb vs. Sql Interoperability
- From: Alex Maghen
- Re: OleDb vs. Sql Interoperability
- Prev by Date: Re: SqlCommandBuilder - not setting my identity column
- Next by Date: Re: OleDb vs. Sql Interoperability
- Previous by thread: Re: OleDb vs. Sql Interoperability
- Next by thread: Re: OleDb vs. Sql Interoperability
- Index(es):
Relevant Pages
|