我正在尝试使用 LINQ 从 SQL-Server 数据库中读取数据,如下所示:-
Public Module MyMod
Public db As MyDatabaseDataContext
End Module
Partial Public Class MyDatabaseDataContext
Public ReadOnly Property MyProperty As MyTableRow
Get
Static my_object As MyTableRow
If my_object Is Nothing Then
my_object = (From a In db.GetTable(Of MyTableRow)()).First
End If
return my_object
End Get
End Property
End Class
到目前为止,我在项目中还没有足够先进来尝试运行它,但不久前我在 MyDatabaseDataContext 中添加了一个存储过程(通过拖放),现在开始出现编译错误......
'GetTable' is not a member of 'MyProject.MyDatabaseDataContext'
(我一直在关注本教程来介绍 LINQ。)
有谁知道这是怎么回事?