
April 22nd, 2001, 07:41 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
How to convert from Date to String then back to DateTime type
<i><b>Originally posted by : Melvin Ram (micheal10@hotmail.com)</b></i><br />Here is the code:<br />------------------------------------------------------------------------------------------------------------------------------------------------------<br />TheKingz.Schedule Schedule = new TheKingz.Schedule();<br />DataTable GetNextName = Schedule.GetNextGame();<br />NextGameInfo_DL.DataSource = GetNextName.DefaultView;<br />NextGameInfo_DL.DataBind();<br /><br />// this is where the problem is: I can't get it to initiallize<br /><br />DateTime NextGame = GetNextName.Columns[0].Table.Rows[0].ItemArray.GetValue(1).ToString();<br /><br />// This is the reason for the code.<br />string strNextGameDay = NextGame.DayOfWeek.ToString();<br /><br />//Day is a label<br />Day.Text = strNextGame;
|