10
Answers

Please Help Linq Problem - Update

Anthony Clarke

Anthony Clarke

13y
1.5k
1
Hi,

Can you tell me why im getting this insert error and how i would resolve it please

Violation of PRIMARY KEY constraint 'PK_CustomFieldsData'. Cannot insert duplicate key in object 'dbo.CustomFieldsData'.
The statement has been terminated.

EbillzNotesDataContext

var

where (p.CustomerCode == cuscode) && (p.FieldID == Convert.ToInt32(27))

select p).FirstOrDefault();


t.FieldValue = "PAYMENT PLAN" 

t.LinkID = " Customer"

EB.SubmitChanges();

I'm only trying to update the table, not insert a new record????

Thanks for your help

Anthony

t = (from p in EB.CustomFieldsDatas
EB = new EbillzNotesDataContext();
Answers (10)