Hello, I have a droughtDataTableAdapter which has the sqlINSERT INTO [droughtDataTable] ([StateName], [Moist], [Drought], [region], [district], [ID]) VALUES (@StateName, @Moist, @Drought, @region, @district, @ID)
In the code I have the codeDataSet1TableAdapters.droughtDataTableAdapter k1 = new DataSet1TableAdapters.droughtDataTableAdapter();
for (int a = 0; a <= 254; a++)
k1.FillDrought( k[a], double.Parse(k[a]), double.Parse(k[a]), 1, k[a],a);
However I got an error
Violation of PRIMARY KEY constraint 'PK_droughtDataTable_1'. Cannot insert duplicate key in object 'dbo.droughtDataTable'.
The question is that I don't have 'droughtDataTable_1', where is from for "_1"?
The definition of the table droughtDataTable isStateName nchar(10)
ID int (Primary Key)
Thanks for help.
View Complete Post