Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Mar 7th, 2006, 11:45 PM   #1
jcrcarmo
Newbie
 
Join Date: Feb 2006
Posts: 11
Rep Power: 0 jcrcarmo is on a distinguished road
Question C# VS 2005 - SQL Query Parameters to an ODBC DataSource

Hello everyone,

I used to have my MS Access 2002 DataBase placed in my application folder and connect to it through an OLEDB connection. Everything worked fine.

Now I decided to create an ODBC DataSource and suddenly I'm not able to pass parameters to the SQL Query the way I used to with the OLEDB connection.

Here's a sample code of the SQL Query and C# code on my form:

FillByClienteDataNumero query:

SELECT Data, Cliente, Tipo, Número, Espécie, Lote, Análise, Preço 
FROM qryALL1 
WHERE (Cliente = ?) AND (Data >= ?) AND (Data <= ?) AND (Tipo = ?) 
ORDER BY Data, Número

Form code:

private void btnSeekBA_Click(object sender, EventArgs e) 
{ 
try 
{ 
this.qryALL1TableAdapter.FillByClienteDataTipo(this.sascrDataSet.qryALL1, cbCliente.Text, new System.Nullable<System.DateTime>(((System.DateTime)(System.Convert.ChangeType(DataIni.Text, typeof(System.DateTime))))), new System.Nullable<System.DateTime>(((System.DateTime)(System.Convert.ChangeType(DataFin.Text, typeof(System.DateTime))))), "Boletim"); 
} 
catch (System.Exception ex) 
{ 
System.Windows.Forms.MessageBox.Show(ex.Message); 
} 
}

Any ideas why the above SQL query and code work with an OLEDB connection but not with an ODBC DataSource? Thanks a million!

JC.
jcrcarmo is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:49 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC