I am using the followig code:
SqlConnection con = new SqlConnection(strcon);
con.Open();
string strSelect = "Select PaidUntil from Users where username='" + un +
"'";
SqlCommand cmd = new SqlCommand(strSelect, con);
SqlDataReader dr;
dr = cmd.ExecuteReader();
dr.Read();
DateTime PaidUntil;
PaidUntil = DateTime.Parse(dr.GetValue(0));
if (PaidUntil < DateTime.Now)
The problem is with the line where I am trying to declare the PaidUntil
local variable. I get the error:
Compiler Error Message: CS1502: The best overloaded method match for
'System.DateTime.Parse(string)' has some invalid arguments
Also, I have not got to the comparison part, but is that correct or should I
be using something like:
DateTime.Compare(PaidUntil, DateTimeNow())
Thanx for your help.
--
Anil Gupte
www.keeninc.net
www.icinema.com