[dba-VB] OleDBAdapter vs SQLDataAdapter

Eric Barro ebarro at afsweb.com
Mon Nov 15 14:00:45 CST 2004


That's the recommendation. I use OLEDB adapter commands for accessing MDBs and SQL adapter commands for accessing SQL dbs. I believe it has to do with how the drivers are optimized for each back end.

-----Original Message-----
From: Nicholson, Karen [mailto:cyx5 at cdc.gov]
Sent: Monday, November 15, 2004 11:57 AM
To: ebarro at afsweb.com; dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] OleDBAdapter vs SQLDataAdapter


Got it.  But, question, still.  Is it true that if you have an SQL
backend that it is better to use the SQL Adapters instead of the OLE
adapters?

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Monday, November 15, 2004 2:40 PM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] OleDBAdapter vs SQLDataAdapter


me.startdate.text

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com]On Behalf Of Nicholson,
Karen
Sent: Monday, November 15, 2004 11:24 AM
To: dba-vb at databaseadvisors.com
Subject: RE: [dba-VB] OleDBAdapter vs SQLDataAdapter


So if my @startdate is an unbound field on a form, then @startdate =
me.startdate.value?

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of
chizotz at mchsi.com
Sent: Monday, November 15, 2004 2:20 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] OleDBAdapter vs SQLDataAdapter


You can parameters to the data adapter select command. Here's a C#
example, 
which you should be able to adapt to VB pretty easily:

dsADARpt1.Clear();
daADARpt.SelectCommand.Parameters["@startDate"].Value = startDate;
daADARpt.SelectCommand.Parameters["@endDate"].Value = endDate;
daADARpt.Fill(dsADARpt1);

The SQL in the data adapter uses the parameters basically exactly as you
are 
used to, for example the SQL in the above referenced data adapter
includes a 
line:

WHERE (dw_draw1.draw_date >= @startDate) AND (dw_draw1.draw_date <=
@endDate)

I hope that helps.

Ron

> I read that if a database has an SQL backend, then use the
> SQLDataAdapter in VB.net.  OK... So, up until this point I have used
OLE
> and could pass parameters easily, for instance:
> 
> Select au_id, au_lname, state from authors where (state = ?)
> 
> If I am using the SQLDataAdapter this bombs.  What is the SQL
> equivalent, or is this a bad idea to even use the SQL adapter?
Learning
> is such a bear.
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> 

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com

_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com








----------------------------------------------------------------
The information contained in this e-mail message and any file, document,
previous e-mail message and/or attachment transmitted herewith is
confidential and may be legally privileged. It is intended solely for
the private use of the addressee and must not be disclosed to or used by
anyone other than the addressee. If you receive this transmission by
error, please immediately notify the sender by reply e-mail and destroy
the original transmission and its attachments without reading or saving
it in any manner.  If you are not the intended recipient, or a person
responsible for delivering it to the intended recipient, you are hereby
notified that any disclosure, copying, distribution or use of any of the
information contained in or attached to this transmission is STRICTLY
PROHIBITED. E-mail transmission cannot be guaranteed to be secure or
error free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a result of
email transmission. Users and employees of the e-mail system are
expressly required not to make defamatory statements and not to infringe
or authorize any infringement of copyright or any other legal right by
email communications. Any such communication is contrary to company
policy. The company will not accept any liability in respect of such
communication.


_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com








----------------------------------------------------------------
The information contained in this e-mail message and any file, document, previous e-mail message and/or attachment transmitted herewith is confidential and may be legally privileged. It is intended solely for the private use of the addressee and must not be disclosed to or used by anyone other than the addressee. If you receive this transmission by error, please immediately notify the sender by reply e-mail and destroy the original transmission and its attachments without reading or saving it in any manner.  If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of any of the information contained in or attached to this transmission is STRICTLY PROHIBITED. E-mail transmission cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of email transmission. Users and employees of the e-mail system are expressly required not to make defamatory statements and not to infringe or authorize any infringement of copyright or any other legal right by email communications. Any such communication is contrary to company policy. The company will not accept any liability in respect of such communication.





More information about the dba-VB mailing list