What is the problem with my pages??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • devilfrank
    New Member
    • Feb 2010
    • 5

    What is the problem with my pages??

    Hi guys. Just new here and I really need a big help on this project of mine. We are using visual studio 2005 and SSMSE for this project. I had already created some pages which is capable of inserting and updating the values on the sql server. After inserting and updating it will redirect to another page to view the result. When I add a homepage, something just mess up. When I insert a new items for the table, it prompts a message, DBnulls cannot be converted to type integer. When I try to check at the sql tables, the data was inserted but I was not able to view the result on the other page. :`( :`( :`(
    Please help, Im just a beginner in this field and I really want to learn more...
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Frank,

    You have posted in the classic ASP forum (file extension .asp or .jsp, languages supported: VBScript and JScript), but I see you were using VS2005 as your IDE. Should this be moved to the ASP.NET forum (file extension .aspx etc, all .net languages supported)?

    Jared

    Comment

    • devilfrank
      New Member
      • Feb 2010
      • 5

      #3
      Yeah sure. Sorry about the mistake. Just new on this field. Thanks so much...

      Comment

      • semomaniz
        Recognized Expert New Member
        • Oct 2007
        • 210

        #4
        Can you please post you code for further help?

        Comment

        • jhardman
          Recognized Expert Specialist
          • Jan 2007
          • 3405

          #5
          no problem Frank.

          Jared

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            When retrieving information from a database you should always check to make sure it is not DBNull before you attempt to use it....

            You should also consider properly casting between data types (are you using C# or VB.NET?) to avoid problems like this. If you are expecting an Integer from the database then you should cast the data retrieved into that type.

            Sometimes there is nothing in a field retrieved by the database. In this case the database will return you DBNull. You can use the DBNull class to make sure that the data returned is not DBNull before you attempt to cast it or use it. You need to use the DBNull.Value to do this.

            I would be able to help you better if you posted the code that isn't working (please remember to use code tags when posting code).

            -Frinny

            Comment

            Working...