i have a win application in c# where i would obtain a linq query with a where condition containing a Data concatened by table fields. my query is :
var fatture = (from t016 in cont.T016_FATT
where t016.ID_FATTURA = aiIdFattura
&& Convert.toDateTime("01" + t016.COD_MESE+"/"+t016.ANNO) > aiData
select t016).ToList();
where t016.COD_MESE is a string rapresenting month value, aiIdFattura is a decimal parameter passed in function and aiData is a DateTime parameter.
but this linq query gives me this error:
LINQ to Entities does not recognize the method Convert.ToDateTime
i have found in internet a solution suggesting to use DBFunctions that is present in EntityFramework (version 6) but i have a minor version of EntityFramework so i cannot use this function.
another found solution was to format date before linq query but in my case is not possible because depending from T016_FATT so i cannot format my date first.
so have you any idea to suggest me?
thanks a lot
aiData? (or potentially store the full date, or ping a calendar table)