Error during tableAdapterManager.UpdateAll unable to resolve

  • Thread starter Thread starter Kotresh Kumar
  • Start date Start date
K

Kotresh Kumar

Guest
In Windows form , Im 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);

}

Im 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 Im 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?

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

Continue reading...
 
Back
Top