Cor
Mon Aug 21 00:38:10 CDT 2006
Alex,
No this sample above does not help you :-)
Maybe this one,
http://www.vb-tips.com/dbpages.aspx?ID=8c3dc2d7-1232-4dd1-817e-22eaaebb2723
By the way, I have nothing to add to the text from Kevin,
Cor
"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> schreef in bericht
news:ObUhNHOxGHA.4192@TK2MSFTNGP06.phx.gbl...
> 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@newsgroup.nospam> schreef in bericht
> news:E7F84D60-43F3-4685-8253-462F1B0296F3@microsoft.com...
>> 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@newsgroup.nospam> schreef in bericht
>>> news:EE0F0CD2-F333-450B-BC13-AD6D22FF11B0@microsoft.com...
>>> > 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
>>> >
>>>
>>>
>>>
>
>