I am writing this code. Here dt is input into the function, as well as someint. The column Exp is a T-SQL date column, which comes as a DateTime through Linq.
May be good idea if you would first change your Sql query to Linq and process linq query instead.
Just add ToList() or limit record
return (from a in dataContext.TableOfA.ToList()
where a.name == "Test" &&
a.Exp.Value.AddDays(Convert.ToDouble(Someint)) >= new DateTimeOffset(dt)
select a).First();
So once you have all your stuff in Linq then you can process more effectivly I think.
Cheers