Posted on: 1/7/2015 4:52:11 PM | Views : 531

I'm retrieving  a datetime value called lastsigintime from sql database, then as I use sqlreader to bring it into my C# class, will turn into a string .ToString:
lastsignintime = reader["lastsignintime"].ToString(),
now I want to evaluate it against a present time var created below, with "aweek" representing a  value seven days ago:
DateTime rightnow = DateTime.Now; DateTime aweek = rightnow.AddDays(-7); .......... else if (user.SignInAccount == string.Empty && (user.lastsignintime > aweek) && user.Domain != string.Empty)
I cannot use the > operator on string, having confusion using a cast or convert  ((datetime)user.lastsignintime > (datetime)aweek) ... Insights greatly wecomed / appreciated
Ned

Go to the complete details ...