Author: zhshqzyc | Posted on: 9/15/2010 4:09:33 PM | Views : 1171

 Hello, I have a droughtDataTableAdapter which has the sql
INSERT INTO [droughtDataTable] ([StateName], [Moist], [Drought], [region], [district], [ID]) VALUES (@StateName, @Moist, @Drought, @region, @district, @ID)
In the code I have the code
DataSet1TableAdapters.droughtDataTableAdapter k1 = new DataSet1TableAdapters.droughtDataTableAdapter(); for (int a = 0; a <= 254; a++) { k1.FillDrought( k[a][0], double.Parse(k[a][9]), double.Parse(k[a][12]), 1, k[a][1],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 is

 Go to the complete details ...