Anthony Clarke

Anthony Clarke

  • NA
  • 127
  • 0

Please Help Linq Problem - Update

Jul 8 2011 8:43 AM
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)