SQL Compact データベースで linq to sql を使用する vb.net アプリがあります。データベースの日付フィールドを NULL 可能に更新し、sqlmetal を使用して dbml を再生成しました。アプリケーションを実行すると、[検索] ボタンをクリックした後に次のランタイム エラーが発生します。
メソッドが見つかりません: 'System.Nullable`1 Downtime.Students.get_DateOfBirth()'.
データ型に加えた最後の変更も問題を引き起こしていることに気付きました。たぶん私はdbmlファイルを正しく更新していませんか?dateOfBirth フィールドの .designer.vb ファイルに次のメソッドがあります。
<Global.System.Data.Linq.Mapping.ColumnAttribute(Name:="dateOfBirth", Storage:="_DateOfBirth", DbType:="DateTime")> _
Public Property DateOfBirth() As System.Nullable(Of Date)
Get
Return Me._DateOfBirth
End Get
Set
If (Me._DateOfBirth.Equals(value) = false) Then
Me.OnDateOfBirthChanging(value)
Me.SendPropertyChanging
Me._DateOfBirth = value
Me.SendPropertyChanged("DateOfBirth")
Me.OnDateOfBirthChanged
End If
End Set
End Property