Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Class statement reference

$
0
0

I want to write a class statement like the one below.  It does not have any reference to db.mdf so there is an error in Me.Products.  I have dragged the "Products" table into a dbml if that helps anything.

db = new DBDataContext(c:\path\db.mdf)

class1.vb

Partial Public Class DBDataContext
     Dim Products As Object
     Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of Products)
          Return From p In Me.Products _
                    Where p.ProductID = id1 _
                     Select p
     End Function
End Class




Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>