Error during tableAdapterManager.UpdateAll unable to resolve
-
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]
GOSET IDENTITY_INSERT [dbo].[Project_Table] ON
goAnother 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?
-
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]
GOSET IDENTITY_INSERT [dbo].[Project_Table] ON
goAnother 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?
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[^]