こんにちは、LinqToSql オブジェクトを使用して .sdf ファイルにデータを保存しようとしています。次のようなテーブルがあります-
PersonId int not null pk
forename nvarchar(4000)
surname nvarchar(4000)
Birthdate DateTime
IsMale bit
Biography nvarchar(4000)
PersonId 列以外のすべてのフィールドに値を挿入しています (identity、increment に設定)。
私はのC#コードを使用しています
myLinqToSqlObject.Persons.InsertOnSubmit(thisPerson);
それから
thisDataContext.SubmitChanges();
「呼び出しのターゲットによって例外がスローされました」という例外が発生します。「Varchar」だけの内部例外
誰かが私が間違っていることを知っていますか?
ありがとう
編集 - thisPerson に入力するコードの表示
thisPerson.Forename = thisDlg.Forename;
thisPerson.Surname = thisDlg.Surname;
thisPerson.Biography = thisDlg.Biography;
thisPerson.IsMale = thisDlg.IsMale;
thisPerson.BirthDate = thisDlg.BirthDate;
すべてのフィールドが値を返す場所 (null 値なし)