我有一个带有“作者”表的数据库“Pubs”。我通过拖动“作者”从数据库中创建了一个 dbml 文件。
这是“Default.aspx.vb”
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New PubsContext
Dim products = From p In db.authors _
Select p
GridView1.DataSource = author
GridView1.DataBind()
End Sub
End Class
这是它的类:“Class1.vb”
Partial Public Class PubsContext
Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of authors)
Return From p In Me.authors _
Where p.ProductID = id1 _
Select p
End Function
End Class
作者和作者的更正有一个红色下划线。我应该怎么办?