Um...
html = "<span"> 0 ? " style=\"color:red;\"" : "") + ">";
Should that double quote after
span
be there? I'm not sure exactly what you are trying to do there, because the VB code doesn't look like it should compile either...
Update from OP:
html = "<span" + (DateDiff("d", rs["display_until_date"], Now()) > 0 ? " style=\"color:red;\"" : "") + ">";
Ah!
Simple:
Cast the return value as a DateTime (if you DB has DATETIME or DATE values):
DateTime until (DateTime) rs["display_until_date"];
Or use Parse is you have got it wrong ans store it as a string:
DateTime until = DateTime.Parse(rs["display_until_date"].ToString());
Then:
html = "<span" + (until - DateTime.Now).TotalDays > 0 ? " style=\"color:red;\"" : "") + ">";