Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.74 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Class structure of database in a asp.net program
  2. Partial Public Class PubsContext
  3.     Dim authors As Object
  4.     Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of authors)
  5.         Return From p In Me.authors _
  6.                Where p.au_id = id1 _
  7.                Select p
  8.     End Function
  9. End Class
  10.        
  11. Public Class _Default
  12.     Inherits System.Web.UI.Page
  13.     Dim author As Object
  14.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  15.         Dim db As New PubsContext("c:SQL Server 2000 Sample DatabasesPUBS.MDF")
  16.         Dim authors = From p In db.authors _
  17.                       Select p
  18.         GridView1.DataSource = author
  19.         GridView1.DataBind()
  20.     End Sub
  21. End Class