C# VS 2005 - SQL Query Parameters to an ODBC DataSource

jcrcarmo

Active member
Joined
Dec 14, 2005
Messages
32
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 Im not able to pass parameters to the SQL Query the way I used to with the OLEDB connection.

Heres a sample code of the SQL Query and C# code on my form:

FillByClienteDataNumero query:

Code:
SELECT Data, Cliente, Tipo, N
 
Does either version work if you simplify the parameters?
i.e. instead of
C#:
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");
try
C#:
this.qryALL1TableAdapter.FillByClienteDataTipo(this.sascrDataSet.qryALL1, cbCliente.Text, System.DateTime.Parse(DataIni.Text), System.DateTime.Parse(DataFin.Text), "Boletim");
 
Hi dear Portuguese friend,

As this is a forum, and here you discuss things, we suggest ideas, and we take out dought sharing the knowlegde and the experience of each one, I wanna suggest that using accented word as (
 
Back
Top