1

I'm encountering an error while using DataSet designer to create a TableAdapter. This is the query i used:

    SELECT        Demande.Fonctionnaire, Demande.DateDemande, Demande.IdDemande, Demande.PremierNumSerie, Demande.Quantite, Stock.Departement, Stock.Imprim
FROM            (Demande INNER JOIN
                         Stock ON Demande.IdStock = Stock.IdStock)
WHERE        ([MONTH](Demande.DateDemande) = ?)

This is the error i get

Generated SELECT statement. OleDbCommand.Prepare method requires parameters of type '14' have an explicitly set Precision and Scale.

To add these components to your dataset, click Finish.

I tried this answer but nothing has changed. So how solve this or how to use MONTH as parameter in TableAdapter ?

user4374239
  • 93
  • 2
  • 11
  • Do notice that the error refers to how the parameters are assigned to the `OleDbCommand` but you only provide the SQL, no c# code whatsoever. Check the help page [mcve] – Cleptus Mar 14 '19 at 08:38
  • this error is in DataSet Designer so no need to c# code – user4374239 Mar 14 '19 at 08:52
  • If the database is SQL Server with `[Month](Table.Column)` you are doing things wrong. the `[ ]` are used to scape reserved words and names with special characters like space and dots in them. You should check the link you provided to make sure you assigned the parameter right and also `MONTH(Demande.DateDemande) = ?`. be careful because not every database does have Month function – Cleptus Mar 14 '19 at 08:59
  • I removed the [ ] and still get same error – user4374239 Mar 14 '19 at 09:02

0 Answers0