locked
Auto-generated DataSet Causing Error RRS feed

  • Question

  • Error:

    "The type name 'PlayerPointsDataTable' does not exist in the type 'Tournamator.PlayerInfoDataSetTableAdapters.PlayerInfoDataSet'    C:\Users\Robert Van Tyne\Documents\Visual Studio 2008\Projects\Tournamator\Tournamator\PlayerInfoDataSet.Designer.cs    1448    51    Tournamator"

    Hi,  I am getting the above error and I am not sure how to fix it.  I have an existing dataset called PlayerInfoDataSet and I went into the designer and added a new column without adding it to actual local sql server data source first.  I then did a regenerate the fill/update methods on the table to include the new column I wanted to add.  This is when I first noticed the error.  I then tried to add the column to the local database and tried to redo the generate the fill/update methods for the table adapter.

    I have tried to fix this but I have no idea what is wrong with it.  Here is the designer code:

    namespace Tournamator.PlayerInfoDataSetTableAdapters {
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Fill, true)]
        public virtual int Fill(PlayerInfoDataSet.PlayerPointsDataTable dataTable) {
          this.Adapter.SelectCommand = this.CommandCollection[0];
          if ((this.ClearBeforeFill == true)) {
            dataTable.Clear();
          }
          int returnValue = this.Adapter.Fill(dataTable);
          return returnValue;
        }
        
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, true)]
        public virtual PlayerInfoDataSet.PlayerPointsDataTable GetData() {
          this.Adapter.SelectCommand = this.CommandCollection[0];
          PlayerInfoDataSet.PlayerPointsDataTable dataTable = new PlayerInfoDataSet.PlayerPointsDataTable();
          this.Adapter.Fill(dataTable);
          return dataTable;
        }
        
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
        public virtual int Update(PlayerInfoDataSet.PlayerPointsDataTable dataTable) {
          return this.Adapter.Update(dataTable);
        }
    }
    
    I tried to remove the entire TableAdapters generated code block, and regenerate it but I still get the same error.  It complains about PlayerPointsDataTable for some reason.

    Above are the 3 methods of the generated code that are causing the issue.  I removed the others for simplicity.

    Thanks for any assistance.

     

    Sunday, September 5, 2010 9:02 PM

Answers

  • I fixed the issue.  I deleted the DataSet.xsd from the project.  Then added a new one with the same name and just dragged over the  tables I had before from the database I was using.  This solved the problem and the errors went away. 

    Kira:  I made a mistake when I tried to add a column to the DataSet that wasn't in the database.  I accidentally put it on the DataSet then tried to do the recreate the fill/update methods and that's when everything broke.  I thought I could then just add the missing column to the table and that would fix it but it didn't.  I also tried to remove the extra column I added to both the DataSet and DataTable but that didn't fix the error either.

    • Marked as answer by pacer3231 Wednesday, September 8, 2010 12:21 AM
    Wednesday, September 8, 2010 12:21 AM

All replies

  • Hi pacer,

     

    > I then did a regenerate the fill/update methods on the table to include the new column I wanted to add.

     

    There is no such column in the database, how can you regenerate to include it? If you want to add additional column to the UI control such as DataGridView, you can do it in designer. Change the Sql to add additional column which is not really in the database table is not a proper way.

     

    I would more care of the step you take to add that column not the designer generated code. If you can provide detail step, that is appreciate.

     

    Sincerely,

    Kira Qian

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework!
    Monday, September 6, 2010 7:58 AM
  • I fixed the issue.  I deleted the DataSet.xsd from the project.  Then added a new one with the same name and just dragged over the  tables I had before from the database I was using.  This solved the problem and the errors went away. 

    Kira:  I made a mistake when I tried to add a column to the DataSet that wasn't in the database.  I accidentally put it on the DataSet then tried to do the recreate the fill/update methods and that's when everything broke.  I thought I could then just add the missing column to the table and that would fix it but it didn't.  I also tried to remove the extra column I added to both the DataSet and DataTable but that didn't fix the error either.

    • Marked as answer by pacer3231 Wednesday, September 8, 2010 12:21 AM
    Wednesday, September 8, 2010 12:21 AM