I need to filter the data retrieved from database adding clauses to the where in the SQL.
I'm trying to do this Using subsonic 3, but i'm getting an error... I'm lost!
SubSonic.Query.SqlQuery qry = new SubSonic.Query.SqlQuery();
qry.From<TFCore.Lugare>(); //I'm getting the error here "Object reference not set to an instance of an object."
if (dia != 0) //Add filter condition
qry.Where(TFCore.LugaresTable.DiaColumn).IsEqualTo(dia);
if (subTipo != 0) //Add filter Condition
qry.Where(TFCore.LugaresTable.SubTipoColumn).IsEqualTo(subTipo);
System.Data.IDataReader reader = qry.ExecuteReader();
I've been trying in several other ways and still getting errors. I ignore if this is possible using LINQ. (I'm using Subsonic 3.0.4)