Type 'Application.DataSet' is not defined

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daleykd
    New Member
    • Oct 2007
    • 4

    Type 'Application.DataSet' is not defined

    Hey folks,

    In VS 2005, I'm trying to use the DataSet wizard/designer. I can successfully go thru the entire process, but as soon as it is referenced in one of my forms, I get errors that state:

    Type 'hplcContainer. POCDataSet' is not defined.

    If I go into the form.designer.v b, I can fix it temporarily by either removing hplcContainer. or adding Global. in front. However, as soon as I save the form again, it rewrites the code.

    Does anyone have any ideas why? I did this in a brand new application and it worked fine.

    (This current application has a simple project that calls my Class Library, which is where ALL the work is.)

    Thanks in advance,
    Kyle
  • daleykd
    New Member
    • Oct 2007
    • 4

    #2
    In case anyone is interested...

    It turns out that I had a class with the same name as my root namespace. I guess that confused the automatically created DataSet.

    Kyle

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Originally posted by daleykd
      In case anyone is interested...
      Ah, you're too quick for us. :)

      Anyway, thanks for posting your results. This will be useful for anyone who comes looking for a similar answer in future.

      Comment

      • dgzo
        New Member
        • Feb 2008
        • 2

        #4
        Hi. I'm having the same problem, only that I dont have a class name the same as my project and the compiler always puts before the name of the dataset, the name of my project like this:

        Code:
        Me.UnitsDS = New RequisitionPO.UnitsDS
        where RequisitionPO is the name of my project.

        I temporarily fix this issue doing one of two things. Either deleting the name of my project and leaving the line like this:
        Code:
        Me.UnitsDS = New UnitsDS
        or writing the word global before the name of the project like this:

        Code:
        Me.UnitsDS = New Global.RequisitionPO.UnitsDS
        but then again, when I go to the form and compile again it rewrites the code and the error shows up. And if I add more datasets, the error is reflected in all of them and all the objects that have to do with the datasets such as tableadapters.

        Can anyone give me a clue on how to fix this maddening error?

        Thanks in advance

        Gabriela

        Comment

        • mmorin
          New Member
          • Apr 2008
          • 1

          #5
          I had the same problem but it was due to a form with the same name as the dataset. I renamed the form and everything worked correctly.

          Marty

          Originally posted by dgzo
          Hi. I'm having the same problem, only that I dont have a class name the same as my project and the compiler always puts before the name of the dataset, the name of my project like this:

          Code:
          Me.UnitsDS = New RequisitionPO.UnitsDS
          where RequisitionPO is the name of my project.

          I temporarily fix this issue doing one of two things. Either deleting the name of my project and leaving the line like this:
          Code:
          Me.UnitsDS = New UnitsDS
          or writing the word global before the name of the project like this:

          Code:
          Me.UnitsDS = New Global.RequisitionPO.UnitsDS
          but then again, when I go to the form and compile again it rewrites the code and the error shows up. And if I add more datasets, the error is reflected in all of them and all the objects that have to do with the datasets such as tableadapters.

          Can anyone give me a clue on how to fix this maddening error?

          Thanks in advance

          Gabriela

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            dgzo, if you get a chance, please let us know how it turned out.

            Comment

            • Makandriaco
              New Member
              • Aug 2010
              • 1

              #7
              3 years later and this post was really helpfull. I think Microsoft could have made the error clearer or fix the mixup. It is not uncommon (although not recomended) that people name a form same as the project.
              Thank you

              Comment

              • Coder Poster

                #8
                same problem here, solution was deleting the namespace I used in a module.
                visual studio walks a path of namespace.class name/formnames and if you are messing with one of those on your own you are 'het bokje'

                Comment

                • Mark J

                  #9
                  Thanks that was really helpful

                  Comment

                  • chaimaFI
                    New Member
                    • Sep 2012
                    • 1

                    #10
                    gratfull

                    thx a looot i aprociate you for you answer

                    Comment

                    Working...