locked
Can't add event to Calendar in Clubsite RRS feed

  • Question

  • User1988740161 posted

     I've downloaded the original clubsite kit and it seems to be working locally, except when I try to add and event.  I am logged in as admin and I can add news articles and upload photos.  When I try to add an event I get the following error.  Does anyone know about this error and how to fix it?  Thanks Bev 

    I've set debugg to true and tried again and I got this message.

    Conversion from type 'DBNull' to type 'String' 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: Conversion from type 'DBNull' to type 'String' is not valid.

    Source Error:

    Line 64:                     <div>
    Line 65:                         <p>
    Line 66:                             <asp:Label ID="descriptionLabel" runat="server" Text='<%# truncate(CStr(Eval("description"))) %>' />
    Line 67:                             <a href='<%# "Locations_view.aspx?Locationid=" &Cstr( Eval("ID"))%>'>more details &raquo;</a></p>
    Line 68:                         </p>


    Source File: C:\Users\bev\Documents\My Web Sites\ClubSite2\Locations_Picker.ascx    Line: 66

    I've searched through the forums and found a couple of hints, but I'm new at this and need pretty specific instructions.  I think I have to change description from DBNull to Cstr, but I don't know where and how.  Can someone tell me how to fix this?  Thanks   Bev 

     


    Conversion from type 'DBNull' to type 'String' 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: Conversion from type 'DBNull' to type 'String' is not valid.

    Source Error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

      <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
       <system.web>
           <compilation debug="true"/>
       </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

    Stack Trace:

    [InvalidCastException: Conversion from type 'DBNull' to type 'String' is not valid.]
       Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Object Value) +591
       ASP.LocationsPicker.__DataBinding__control3(Object sender, EventArgs e) +97
       System.Web.UI.Control.OnDataBinding(EventArgs e) +99
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.WebControls.FormView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2176
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
       System.Web.UI.WebControls.FormView.PerformDataBinding(IEnumerable data) +9
       System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       System.Web.UI.WebControls.FormView.DataBind() +4
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.Control.DataBind() +12
       System.Web.UI.Control.DataBindChildren() +204
       System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
       System.Web.UI.WebControls.FormView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +2176
       System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
       System.Web.UI.WebControls.FormView.PerformDataBinding(IEnumerable data) +9
       System.Web.UI.WebControls.FormView.EnsureDataBound() +128
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +21
       System.Web.UI.Control.FindControl(String id) +9
       ASP.events_edit_aspx.Page_Load(Object sender, EventArgs e) +164
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434

    Wednesday, October 8, 2008 5:24 AM

All replies

  • User-109503533 posted

     Bev,

    It is late to answer this but I found by putting a space in the code (sorry I can't remember where) solved the problem form me.

    Bill

     

    Monday, February 9, 2009 9:06 AM
  • User-1587472252 posted

    I have exactly this problem. I am trying to add an event starting and ending on the same day. I have already created an event location for it.  Has anyone found a solution in the last 9 months? Cos I really can't use a Club site where I can't add events.

    Monday, July 13, 2009 10:03 AM
  • User-1773948845 posted

    I have exactly this problem. I am trying to add an event starting and ending on the same day. I have already created an event location for it.  Has anyone found a solution in the last 9 months? Cos I really can't use a Club site where I can't add events.

     

    http://forums.asp.net/t/1459792.aspx - check this post.

    events are added . can u be more clear on the problem

     

    Thursday, August 20, 2009 7:11 AM