Dataset Headaches

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt MacDonald

    #1

    Dataset Headaches

    Hi all,
    First of all, I am not trying to be the guy who comes in here shouting his
    mouth off at Microsoft. However, ever sinse I started using typed datasets
    in VS2005 I have been fighting with a recurring issue.

    I will have a project open and be working in it just fine, when all of a
    sudden when I try to do something in my dataset (either add a new query,
    modify and existing one, etc.) I get a big fat error box on my screen
    telling me that it couldn't find the connection string. Nothing has been
    changed (manually) in the project in regards to the connection strings,
    either in the web.config or the application settings.

    Probably about 70% of the time, I can just drag a new table in the dataset
    from the data explorer and that recreates the "lost" connection and
    everything is fine for now. However, the other 30% of the time, I will try
    that and it may appear to work at a glance, but then suddenly my code has
    about 80 errors in it because the class that should have been generated by
    that dataset has a random error in it. In the latest case I get "Error 101
    Custom tool error: Failed to generate code. Unable to convert input xml file
    content to a DataSet. Requested value 'My' was not found. Requested value
    'My' was not found."

    OK, so now my only option other than trying to hunt down the elusive "My"
    that it's looking for, is to pull up the latest backup and try to merge my
    changes into that one back when the dataset was still working. After going
    through all this effort to get back to where I already was, I just need to
    look forward to it happening all over again sometime in the near future.

    I can't believe that I'm the only one going through this and it seems like
    by now, there really should be some sort of resolution. I really like what
    you are able to do using typed datasets, and have been pushing them at my
    company ever sinse I started using them, but somedays the aggravation they
    cause makes me want to go back to just doing everything manually.

    OK, so thanks for letting me vent. Again, I'm not trying to "blame" anyone
    in particular, I'm just trying to get a resolution. Does anyone have any
    suggestions?

    Thanks,
    Matt


  • Mr. Arnold

    #2
    Re: Dataset Headaches

    OK, so thanks for letting me vent. Again, I'm not trying to "blame"
    anyone
    in particular, I'm just trying to get a resolution. Does anyone have any
    suggestions?
    >
    You can use a strong typed Collection of Data Objects that persist
    themselves to the database.

    Comment

    • Matt MacDonald

      #3
      Re: Dataset Headaches

      Mr. Arnold wrote:
      >
      >OK, so thanks for letting me vent. Again, I'm not trying to "blame"
      >anyone
      >in particular, I'm just trying to get a resolution. Does anyone have
      >any suggestions?
      >>
      >
      You can use a strong typed Collection of Data Objects that persist
      themselves to the database.
      Thank you for your suggestion. That doesn't really solve the problem at
      hand, because I can't really go back and re-do the projects I'm
      currently working on, but I may consider that for the future.

      Comment

      • Matt MacDonald

        #4
        Re: Dataset Headaches

        Mr. Arnold wrote:
        >
        >OK, so thanks for letting me vent. Again, I'm not trying to "blame"
        >anyone
        >in particular, I'm just trying to get a resolution. Does anyone have
        >any suggestions?
        >>
        >
        You can use a strong typed Collection of Data Objects that persist
        themselves to the database.
        Thank you for your suggestion. That doesn't really solve the problem at
        hand, because I can't really go back and re-do the projects I'm
        currently working on, but I may consider that for the future.

        Comment

        • Mr. Arnold

          #5
          Re: Dataset Headaches


          "Matt MacDonald" <mattsmac@hotma ill.comwrote in message
          news:468AA5E8.7 00@hotmaill.com ...
          Mr. Arnold wrote:
          >>
          >>OK, so thanks for letting me vent. Again, I'm not trying to "blame"
          >>anyone
          >>in particular, I'm just trying to get a resolution. Does anyone have
          >>any suggestions?
          >>>
          >>
          >You can use a strong typed Collection of Data Objects that persist
          >themselves to the database.
          >
          Thank you for your suggestion. That doesn't really solve the problem at
          hand, because I can't really go back and re-do the projects I'm
          currently working on, but I may consider that for the future.
          Visual Paradigm's NHibernate

          Comment

          • Jim Rand

            #6
            Re: Dataset Headaches

            Hi Matt,

            Rather than creating a dataset and dragging tables on to it with the VS 2005
            designer, go back to the old VS 2003 method (using VS 2005) of

            - Create a new component
            - Drag your data adapters onto it
            - Create a new dataset from the adapters.

            This way, your dataset is independent of the underlying connection. It
            really doesn't need a connection anyway. Just the adapters do.

            I've heard that Microsoft is dropping this whole table adapter crap in VS
            2008.

            Jim

            "Matt MacDonald" <mattsmac@hotma il.comwrote in message
            news:%23BdOSdav HHA.4784@TK2MSF TNGP06.phx.gbl. ..
            Hi all,
            First of all, I am not trying to be the guy who comes in here shouting
            his mouth off at Microsoft. However, ever sinse I started using typed
            datasets in VS2005 I have been fighting with a recurring issue.
            >
            I will have a project open and be working in it just fine, when all of a
            sudden when I try to do something in my dataset (either add a new query,
            modify and existing one, etc.) I get a big fat error box on my screen
            telling me that it couldn't find the connection string. Nothing has been
            changed (manually) in the project in regards to the connection strings,
            either in the web.config or the application settings.
            >
            Probably about 70% of the time, I can just drag a new table in the dataset
            from the data explorer and that recreates the "lost" connection and
            everything is fine for now. However, the other 30% of the time, I will
            try that and it may appear to work at a glance, but then suddenly my code
            has about 80 errors in it because the class that should have been
            generated by that dataset has a random error in it. In the latest case I
            get "Error 101 Custom tool error: Failed to generate code. Unable to
            convert input xml file content to a DataSet. Requested value 'My' was not
            found. Requested value 'My' was not found."
            >
            OK, so now my only option other than trying to hunt down the elusive "My"
            that it's looking for, is to pull up the latest backup and try to merge my
            changes into that one back when the dataset was still working. After
            going through all this effort to get back to where I already was, I just
            need to look forward to it happening all over again sometime in the near
            future.
            >
            I can't believe that I'm the only one going through this and it seems like
            by now, there really should be some sort of resolution. I really like
            what you are able to do using typed datasets, and have been pushing them
            at my company ever sinse I started using them, but somedays the
            aggravation they cause makes me want to go back to just doing everything
            manually.
            >
            OK, so thanks for letting me vent. Again, I'm not trying to "blame"
            anyone in particular, I'm just trying to get a resolution. Does anyone
            have any suggestions?
            >
            Thanks,
            Matt
            >

            Comment

            • Matt MacDonald

              #7
              Re: Dataset Headaches

              Again, thanks for the suggestion, but I'm kind of past the point where I can
              just start my whole data layer over again. I need to be able to fix what I
              have.

              Thanks,
              Matt

              "Jim Rand" <jimrand@ix.net com.comwrote in message
              news:ukoLnYbvHH A.2352@TK2MSFTN GP03.phx.gbl...
              Hi Matt,
              >
              Rather than creating a dataset and dragging tables on to it with the VS
              2005 designer, go back to the old VS 2003 method (using VS 2005) of
              >
              - Create a new component
              - Drag your data adapters onto it
              - Create a new dataset from the adapters.
              >
              This way, your dataset is independent of the underlying connection. It
              really doesn't need a connection anyway. Just the adapters do.
              >
              I've heard that Microsoft is dropping this whole table adapter crap in VS
              2008.
              >
              Jim
              >
              "Matt MacDonald" <mattsmac@hotma il.comwrote in message
              news:%23BdOSdav HHA.4784@TK2MSF TNGP06.phx.gbl. ..
              >Hi all,
              > First of all, I am not trying to be the guy who comes in here shouting
              >his mouth off at Microsoft. However, ever sinse I started using typed
              >datasets in VS2005 I have been fighting with a recurring issue.
              >>
              >I will have a project open and be working in it just fine, when all of a
              >sudden when I try to do something in my dataset (either add a new query,
              >modify and existing one, etc.) I get a big fat error box on my screen
              >telling me that it couldn't find the connection string. Nothing has been
              >changed (manually) in the project in regards to the connection strings,
              >either in the web.config or the application settings.
              >>
              >Probably about 70% of the time, I can just drag a new table in the
              >dataset from the data explorer and that recreates the "lost" connection
              >and everything is fine for now. However, the other 30% of the time, I
              >will try that and it may appear to work at a glance, but then suddenly my
              >code has about 80 errors in it because the class that should have been
              >generated by that dataset has a random error in it. In the latest case I
              >get "Error 101 Custom tool error: Failed to generate code. Unable to
              >convert input xml file content to a DataSet. Requested value 'My' was not
              >found. Requested value 'My' was not found."
              >>
              >OK, so now my only option other than trying to hunt down the elusive "My"
              >that it's looking for, is to pull up the latest backup and try to merge
              >my changes into that one back when the dataset was still working. After
              >going through all this effort to get back to where I already was, I just
              >need to look forward to it happening all over again sometime in the near
              >future.
              >>
              >I can't believe that I'm the only one going through this and it seems
              >like by now, there really should be some sort of resolution. I really
              >like what you are able to do using typed datasets, and have been pushing
              >them at my company ever sinse I started using them, but somedays the
              >aggravation they cause makes me want to go back to just doing everything
              >manually.
              >>
              >OK, so thanks for letting me vent. Again, I'm not trying to "blame"
              >anyone in particular, I'm just trying to get a resolution. Does anyone
              >have any suggestions?
              >>
              >Thanks,
              > Matt
              >>
              >
              >

              Comment

              • sloan

                #8
                Re: Dataset Headaches



                I believe you've fallen into the "Rapid Development" trap.

                The quick drag and drop stuff can eventually screw you.
                As you're finding out.
                The development is quick. Maintenance sucks. Do yourself a favor and
                develop a true DAL from the beginning.
                In the long run, it'll save you.

                I'd suggest:
                Create the dataset independant of any underlying table adapter.

                See
                http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!140.entry
                for my example.



                "Matt MacDonald" <mattsmac@hotma il.comwrote in message
                news:%23BdOSdav HHA.4784@TK2MSF TNGP06.phx.gbl. ..
                Hi all,
                First of all, I am not trying to be the guy who comes in here shouting
                his
                mouth off at Microsoft. However, ever sinse I started using typed
                datasets
                in VS2005 I have been fighting with a recurring issue.
                >
                I will have a project open and be working in it just fine, when all of a
                sudden when I try to do something in my dataset (either add a new query,
                modify and existing one, etc.) I get a big fat error box on my screen
                telling me that it couldn't find the connection string. Nothing has been
                changed (manually) in the project in regards to the connection strings,
                either in the web.config or the application settings.
                >
                Probably about 70% of the time, I can just drag a new table in the dataset
                from the data explorer and that recreates the "lost" connection and
                everything is fine for now. However, the other 30% of the time, I will
                try
                that and it may appear to work at a glance, but then suddenly my code has
                about 80 errors in it because the class that should have been generated by
                that dataset has a random error in it. In the latest case I get "Error
                101
                Custom tool error: Failed to generate code. Unable to convert input xml
                file
                content to a DataSet. Requested value 'My' was not found. Requested value
                'My' was not found."
                >
                OK, so now my only option other than trying to hunt down the elusive "My"
                that it's looking for, is to pull up the latest backup and try to merge my
                changes into that one back when the dataset was still working. After
                going
                through all this effort to get back to where I already was, I just need to
                look forward to it happening all over again sometime in the near future.
                >
                I can't believe that I'm the only one going through this and it seems like
                by now, there really should be some sort of resolution. I really like
                what
                you are able to do using typed datasets, and have been pushing them at my
                company ever sinse I started using them, but somedays the aggravation they
                cause makes me want to go back to just doing everything manually.
                >
                OK, so thanks for letting me vent. Again, I'm not trying to "blame"
                anyone
                in particular, I'm just trying to get a resolution. Does anyone have any
                suggestions?
                >
                Thanks,
                Matt
                >
                >

                Comment

                • Vayse

                  #9
                  Re: Dataset Headaches

                  I had a similar issue before. My post is at http://tinyurl.com/2p49qo
                  In my case, the issue was caused by copying a datatable from one xsd to
                  another. Once the problem occurs, there seems to be no way of fixing it.

                  I got tired of fixing the auto generated code, so in the end I just created
                  a new dataset. I let the wizard to most of the initial work, then pasted any
                  new tables one field at a time.
                  Likewise, I just copied the data adapter SQL statements - I made sure not to
                  copy the data adapter.
                  Even if you use Sourcesafe, like I do, restoring prior versions of the xsd
                  will not fix the project.

                  I've stuck to this technique since, and I get a lot less issues.
                  Not what you want to hear, I'm sure! However, it doesn't take that long once
                  you start. Plus you get stick with your current approach, no need to rewrite
                  the rest of the project.

                  Also, I'd recommend starting a brand new project - the connection string
                  seems to be stored in several places. Add your existing forms to the new
                  project. May seem a bit of paranoia , but better than going to all that
                  trouble and then finding the project still has problems.

                  Like you, I like using typed datasets, but it is a very fragile technology.
                  Vayse



                  "Matt MacDonald" <mattsmac@hotma il.comwrote in message
                  news:%23BdOSdav HHA.4784@TK2MSF TNGP06.phx.gbl. ..
                  Hi all,
                  First of all, I am not trying to be the guy who comes in here shouting
                  his mouth off at Microsoft. However, ever sinse I started using typed
                  datasets in VS2005 I have been fighting with a recurring issue.
                  >
                  I will have a project open and be working in it just fine, when all of a
                  sudden when I try to do something in my dataset (either add a new query,
                  modify and existing one, etc.) I get a big fat error box on my screen
                  telling me that it couldn't find the connection string. Nothing has been
                  changed (manually) in the project in regards to the connection strings,
                  either in the web.config or the application settings.
                  >
                  Probably about 70% of the time, I can just drag a new table in the dataset
                  from the data explorer and that recreates the "lost" connection and
                  everything is fine for now. However, the other 30% of the time, I will
                  try that and it may appear to work at a glance, but then suddenly my code
                  has about 80 errors in it because the class that should have been
                  generated by that dataset has a random error in it. In the latest case I
                  get "Error 101 Custom tool error: Failed to generate code. Unable to
                  convert input xml file content to a DataSet. Requested value 'My' was not
                  found. Requested value 'My' was not found."
                  >
                  OK, so now my only option other than trying to hunt down the elusive "My"
                  that it's looking for, is to pull up the latest backup and try to merge my
                  changes into that one back when the dataset was still working. After
                  going through all this effort to get back to where I already was, I just
                  need to look forward to it happening all over again sometime in the near
                  future.
                  >
                  I can't believe that I'm the only one going through this and it seems like
                  by now, there really should be some sort of resolution. I really like
                  what you are able to do using typed datasets, and have been pushing them
                  at my company ever sinse I started using them, but somedays the
                  aggravation they cause makes me want to go back to just doing everything
                  manually.
                  >
                  OK, so thanks for letting me vent. Again, I'm not trying to "blame"
                  anyone in particular, I'm just trying to get a resolution. Does anyone
                  have any suggestions?
                  >
                  Thanks,
                  Matt
                  >

                  Comment

                  Working...