Re: typecast error!

Discussion in 'ASP .Net' started by Joe Van Meer, Feb 1, 2006.

  1. Joe Van Meer

    Joe Van Meer Guest

    seems your system date is off a bit :p

    "Arvind R" <arvind > wrote in message
    news:%...
    > Whats the solution for this?
    >
    > Specified cast is not valid.
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.InvalidCastException: Specified cast is not

    valid.
    >
    > Source Error:
    >
    > Line 118: if ((dr["session_startdate"].ToString() !=
    > DBNull.Value.ToString()))
    > Line 119: {
    > Line 120: DateTime dtEvent = (DateTime)dr["session_startdate"];
    > Line 121:
    > Line 122:public void CalendarDRender(object sender,
    > System.Web.UI.WebControls.DayRenderEventArgs e)
    >
    > {
    >
    >
    > // If the month is CurrentMonth
    >
    > if (!e.Day.IsOtherMonth )
    >
    > {
    >
    > foreach (DataRow dr in ds.Tables[0].Rows)
    >
    > {
    >
    > if ((dr["session_startdate"].ToString() != DBNull.Value.ToString()))
    >
    > {
    >
    > DateTime dtEvent = (DateTime)dr["session_startdate"];
    >
    >
    > // = (DateTime)dr["session_startdate"];
    >
    > if (dtEvent.Equals(e.Day.Date))
    >
    > {
    >
    > e.Cell.BackColor = Color.PaleVioletRed;
    >
    > }
    >
    > }
    >
    > }
    >
    > }
    >
    > //If the month is not CurrentMonth then hide the Dates
    >
    > else
    >
    > {
    >
    > e.Cell.Text = "";
    >
    > }
    >
    > }
    >
    >
     
    Joe Van Meer, Feb 1, 2006
    #1
    1. Advertising

  2. Joe Van Meer

    Bob Lehmann Guest

    Either that, or he's 288 time zones away :>

    Bob Lehmann

    "Joe Van Meer" <> wrote in message
    news:...
    > seems your system date is off a bit :p
    >
    > "Arvind R" <arvind > wrote in message
    > news:%...
    > > Whats the solution for this?
    > >
    > > Specified cast is not valid.
    > > Description: An unhandled exception occurred during the execution of the
    > > current web request. Please review the stack trace for more information
    > > about the error and where it originated in the code.
    > >
    > > Exception Details: System.InvalidCastException: Specified cast is not

    > valid.
    > >
    > > Source Error:
    > >
    > > Line 118: if ((dr["session_startdate"].ToString() !=
    > > DBNull.Value.ToString()))
    > > Line 119: {
    > > Line 120: DateTime dtEvent = (DateTime)dr["session_startdate"];
    > > Line 121:
    > > Line 122:public void CalendarDRender(object sender,
    > > System.Web.UI.WebControls.DayRenderEventArgs e)
    > >
    > > {
    > >
    > >
    > > // If the month is CurrentMonth
    > >
    > > if (!e.Day.IsOtherMonth )
    > >
    > > {
    > >
    > > foreach (DataRow dr in ds.Tables[0].Rows)
    > >
    > > {
    > >
    > > if ((dr["session_startdate"].ToString() != DBNull.Value.ToString()))
    > >
    > > {
    > >
    > > DateTime dtEvent = (DateTime)dr["session_startdate"];
    > >
    > >
    > > // = (DateTime)dr["session_startdate"];
    > >
    > > if (dtEvent.Equals(e.Day.Date))
    > >
    > > {
    > >
    > > e.Cell.BackColor = Color.PaleVioletRed;
    > >
    > > }
    > >
    > > }
    > >
    > > }
    > >
    > > }
    > >
    > > //If the month is not CurrentMonth then hide the Dates
    > >
    > > else
    > >
    > > {
    > >
    > > e.Cell.Text = "";
    > >
    > > }
    > >
    > > }
    > >
    > >

    >
    >
     
    Bob Lehmann, Feb 2, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Fitzpatrick

    Re: typecast error!

    Mark Fitzpatrick, Feb 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,685
    Lau Lei Cheong
    Feb 8, 2006
  2. Otis Mukinfus

    Re: typecast error!

    Otis Mukinfus, Feb 3, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    379
    Terry Burns
    Feb 4, 2006
  3. Tomba

    generics typecast

    Tomba, Jan 9, 2006, in forum: Java
    Replies:
    8
    Views:
    1,340
  4. Martin Himmel
    Replies:
    0
    Views:
    315
    Martin Himmel
    Jul 12, 2006
  5. Martin Himmel
    Replies:
    1
    Views:
    401
    Victor Bazarov
    Jul 12, 2006
Loading...

Share This Page