Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Error during tableAdapterManager.UpdateAll unable to resolve

Error during tableAdapterManager.UpdateAll unable to resolve

Scheduled Pinned Locked Moved Windows Forms
csharpdatabasesql-serverwinformscom
2 Posts 2 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 8352319
    wrote on last edited by
    #1

    In Windows form , I'm displaying a Project_Table using tableAdapterManager. I followed as per http://www.youtube.com/watch?v=3w2JkLcp-UA[^] Project_Id int Primary Key with Identity specification as identity Project_Name nvarchar(50) Project_Type nvarchar(50) Platform_Type nvarchar(50) Start_Date date Customer nvarchar(50) In the code

    private void project_TableBindingNavigatorSaveItem_Click(object sender, EventArgs e)
    {
    this.Validate();
    this.project_TableBindingSource.EndEdit();
    this.tableAdapterManager.UpdateAll(this.pLMDataSet);

        }
    

    I'm getting error Cannot insert explicit value for identity column in table 'Project_Table' when IDENTITY_INSERT is set to OFF Even after executing following script I'm getting same error. :(

    USE [PLM]
    GO

    SET IDENTITY_INSERT [dbo].[Project_Table] ON
    go

    Another table Phases_table has dependency on Project_Table through FK constraint. Is the error because of this constraint?:confused: Are there any sample examples on C# with MSSQL database which use multiple windows forms with multiples table linked in an hierarchy?

    L 1 Reply Last reply
    0
    • U User 8352319

      In Windows form , I'm displaying a Project_Table using tableAdapterManager. I followed as per http://www.youtube.com/watch?v=3w2JkLcp-UA[^] Project_Id int Primary Key with Identity specification as identity Project_Name nvarchar(50) Project_Type nvarchar(50) Platform_Type nvarchar(50) Start_Date date Customer nvarchar(50) In the code

      private void project_TableBindingNavigatorSaveItem_Click(object sender, EventArgs e)
      {
      this.Validate();
      this.project_TableBindingSource.EndEdit();
      this.tableAdapterManager.UpdateAll(this.pLMDataSet);

          }
      

      I'm getting error Cannot insert explicit value for identity column in table 'Project_Table' when IDENTITY_INSERT is set to OFF Even after executing following script I'm getting same error. :(

      USE [PLM]
      GO

      SET IDENTITY_INSERT [dbo].[Project_Table] ON
      go

      Another table Phases_table has dependency on Project_Table through FK constraint. Is the error because of this constraint?:confused: Are there any sample examples on C# with MSSQL database which use multiple windows forms with multiples table linked in an hierarchy?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Member 8387808 wrote:

      I'm getting error Cannot insert explicit value for identity column in table 'Project_Table' when IDENTITY_INSERT is set to OFF

      Means you're passing in a value for the primary key - but that column is readonly, as the database will generate a value for you.

      Member 8387808 wrote:

      Another table Phases_table has dependency on Project_Table through FK constraint. Is the error because of this constraint?:confused:

      Can you explain me the difference between a PK and a FK? If not, no problem - we'll start there.

      Member 8387808 wrote:

      Are there any sample examples on C# with MSSQL database which use multiple windows forms with multiples table linked in an hierarchy?

      Yes. Now a bit more specific, or I'll have to point to a random db-application.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups