How to solve the null problem in the database in clubsite?

Discussion in 'Third-party applications' started by ddeepak, Aug 31, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I have already upload the clubsite in server.

    When i try to edit the news, at that time the description part of the news is left empty or null.

    Then after when i try to open the news pageit gives the following error:-
    Erroris in this linkwww.fitnepal.org.np
    Unable to cast object of type 'System.DBNull' to type 'System.String'.
    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: Unable to cast object of type 'System.DBNull' to type 'System.String'.

    Source Error:






    Code:
    Line 138:                            </h3>
    Line 139:                            <p>
    Line 140:                                <asp:Label ID="Label2" runat="server" Text='<%# SharedRoutines.truncate((string)Eval("description")) %>' />
    Line 141:                                <a href='<%# "News_View.aspx?Articleid=" + Convert.ToString(Eval("ID")) %>'>read more &amp;raquo;</a>
    Line 142:                            </p>
    Source File: e:\web\unlimitcom1\htdocs\Default.aspx Line: 140

    Please tell me how can i solve that problem. I am in risk stage.

    Thank you.

    Regard
    DD
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    your database has some null values in certain place and the starter kit is not checking for db null. I suggest you take a peek at the database and make sure all the necessary fields are populated.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I am hoping using this thread will help.
    I have a similar issue upload and deploying Clubsite

    I get this error:

    Compilation Error
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0103: The name 'SharedRoutines' does not exist in the current context

    Source Error:



    Line 24: </h3>
    Line 25: <p>
    Line 26: <asp:Label ID="Label2" runat="server" Text='<%# SharedRoutines.truncate((string)Eval("description")) %>' />
    Line 27: <a href='<%# "News_View.aspx?Articleid=" + Convert.ToString(Eval("ID")) %>'>read more
    Line 28: &raquo;</a>


    Source File: e:\web\commandosac\htdocs\WebPartControls\RecentNews.ascx Line: 26

    Please help.
     
  4. Hi,
    Looks like you need to qualify and trap and nulls if the description comes back invalid.
    You can expand everything between those delimiters and add conditional code there.
    All the best,
    Mark
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page