Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
hi again,
 
here is my code :
int n = dsCfg.tblCfg.Columns.Count;
 
Object[] ao = new object[n];
 
ao[0] = "SETTINGS";
ao[1] = 0;
ao[2] = some value
 
dsCfg.tblCfg.LoadDataRow(ao,false);
taCfg.Update(dsCfg.tblCfg); // -> throws exception : cannot insert duplicate PRIMARY KEY
tblCfg has 6 columns : 0=nchar(10), 1=int, all others are type sqlvariant; 0 and 1 build PRIMARY KEY
 
so if it can't insert why doesn't it up ?
any help (except try this... (means i don't want to rewrite the project)) appreciated
 
thanks in advance
Posted 14-Feb-13 4:14am
fheyn714
Edited 14-Feb-13 4:32am
v2
Comments
Richard MacCutchan at 14-Feb-13 10:01am
   
I think that message is trying to tell you something.
richcb at 14-Feb-13 10:15am
   
As Richard said, you cannot insert a duplicate primary key. That is your answer, you are attempting to do that and you cannot.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi,
 
got it : TableAdapter's Fill-Methode was missing !
 
now works fine !
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Zoltán Zörgő 300
1 /\jmot 205
2 Peter Leow 165
3 CHill60 145
4 CPallini 135
0 Sergey Alexandrovich Kryukov 9,383
1 OriginalGriff 6,881
2 Peter Leow 4,607
3 Zoltán Zörgő 4,284
4 CHill60 2,892


Advertise | Privacy | Mobile
Web02 | 2.8.150129.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100