So what you are looking for is the day of the week that the date returned
from Request.QuerySt ring["txtboardda te"]? Ahh, I thought you were looking for
the full DateTime class. In either case, take the following code...
string dayOfWeek;
string rqs = Request.QuerySt ring["txtboardda te"];
DateTime rqsday;
rqsday = DateTime.Parse( rqs);
dayOfWeek = rqsday.DayOfWee k.ToString();
One little note, I seem to have had a typo in the last code I gave you in
which rsq was being passed into DateTime.Parse( ), that has been fixed now.
Anyway, here we get the string representing the actual date (ie 7/15/2005),
then have it parsed into an instance of the DateTime class, and finally read
the DayOfWeek property from that instance to determine the actual day of the
week, all without the need for the dddd format conversion to string. If
however you want to use that... you can simply change the associated line to:
dayOfWeek = rqsday.ToString ("dddd");
or the following if you want the {} chars to be part of the output:
dayOfWeek = rqsday.ToString ("{dddd}");
Remember though, that in either case a String is being returned so you
should be sure to store it in such a variable type, unlike the code you
replied with where you are attempting to store that string in rqsday which
has been changed to be a string, rather than a DateTime.
Brendan
".Net Sports" wrote:
Thanks for helping - still, I need to make rqsday into a string that
contains "Friday" or "Thursday" ( whatever day that the 'rqs' falls on)
..
Doing this:
string rqs = Request.QuerySt ring["txtboarddÂ*ate "];
DateTime rqsday;
rqsday = DateTime.Parse( rsq);
rqsday = rqsday.ToString ("{dddd}");
...I still get the Build error pointing to the last line rqsday =
rqsday.ToString ("{dddd}");
the "cannot implicitly convert type 'string' to 'System.DateTim e' error
????
..netsports