locked
InvalidCastException error when viewing or adding data to the events calendar. RRS feed

  • Question

  • User1238662603 posted

    When ever i go to add or view things in the clubsite event calendar i get the following:

    System.InvalidCastException was unhandled by user code
      Message="Unable to cast object of type 'System.DBNull' to type 'System.String'."
      Source="App_Web_fkz-yrfu"
      StackTrace:
           at ASP.events_list_aspx.__DataBinding__control15(Object sender, EventArgs e) in h:\LANCERS\ClubWebSite1\Events_List.aspx:line 130
           at System.Web.UI.Control.OnDataBinding(EventArgs e)
           at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
           at System.Web.UI.Control.DataBind()
           at System.Web.UI.Control.DataBindChildren()
      InnerException:

    Could someone offer me a hand with this.  i really don't know what's going on.

    Wednesday, July 2, 2008 6:38 PM

All replies

  • User-125547262 posted

     Looks like you are retrieving  a value from the database that happens to be null and are trying to cast it to string. See line 130 in your code / post the code so that we can take a look at it

    Wednesday, July 2, 2008 10:34 PM