I have been debugging this query for the last 40 minutes, and the problem apparently is the order of the parameters after all.
SELECT * FROM tblSomeThing WHERE id = @id AND debut = @dtDebut AND fin = @dtFin
Then I add the parameters this way, notice that the two last parameters are switched, I get no results.
cmd.Parameters.Add("@id", OleDbType.Integer).Value = idSociete;
cmd.Parameters.Add("@dtFin", OleDbType.Date).Value = dateTraitementFin;
cmd.Parameters.Add("@dtDebut", OleDbType.Date).Value = dateTraitementDebut;
When I declare the parameters the way they appear in the queury everything works perfectly.
I thought named parameters were at first place to address this problem! what am I missing here?
Thank you