HI, I am trying to save some data to my .sdf file using a LinqToSql object. I have a table as follows -
PersonId int not null pk
forename nvarchar(4000)
surname nvarchar(4000)
Birthdate DateTime
IsMale bit
Biography nvarchar(4000)
I am inserting a value into all fields apart from the PersonId column (set to identity, increment).
I am using the C# code of
myLinqToSqlObject.Persons.InsertOnSubmit(thisPerson);
then
thisDataContext.SubmitChanges();
and i get the exception of "Exception has been thrown by the target of an invocation." and an inner exception of just "Varchar"
Does anyone know what i'm doing wrong?
Thanks
EDIT - Showing code to populate thisPerson
thisPerson.Forename = thisDlg.Forename;
thisPerson.Surname = thisDlg.Surname;
thisPerson.Biography = thisDlg.Biography;
thisPerson.IsMale = thisDlg.IsMale;
thisPerson.BirthDate = thisDlg.BirthDate;
Where all fields return a value (no null values)