Hi, I have a small problem, I am trying to insert a new row into a batabase table using linq to sql.
I have Microsoft publication on Linq but it was based on the beta of Linq and does not match the current version completly.
I have a class P11Entry that is laid out exactly as the db table.
I have the Linq data context named dc
however I am getting a syntax error that I do not understand.
LinqDataContext dc = new LinqDataContext(); P11Entry anEntry = new P11Entry; anEntry.Week_Number = intWeekNum; anEntry.Week_Begining = dtWeekStart; anEntry.EmpID = intEmpID; anEntry.Gross_Pay = decPay; anEntry.Tax = decTaxDue; anEntry.NICs = decNICs; dc.tblP11.InsertOnSubmit(anEntry);//SYNTAX ERROR
The exception is a type exception and I do not understand why. Please can anyone help?
Thanks for your time.