Imports System
Imports System.Collections
Imports System.Text
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class BaseClass
Inherits System.Web.UI.Page
Protected DataGrid1 as DataGrid
Sub Page_Load(Source As Object, E As EventArgs) 
    Dim myConnection As OleDbConnection
    Dim myCommand    As OleDbDataAdapter
    Dim ds           As New DataSet
    Dim ConnStr      As String
    Dim SQL          As String
    'Connection syntax
    ConnStr = "Provider=SQLOLEDB; Data Source=(local); Initial Catalog=ASPNET; User ID=sa"
    myConnection = New OleDbConnection(ConnStr)
    'DataSetCommand
    SQL = "select * from Masters"
    myCommand = New OleDbDataAdapter(SQL, myConnection)
    'use Fill method of DataSetCommand to populate dataset
    myCommand.Fill(ds, "Masters")
    'Binding a Grid	
    DataGrid1.DataSource=ds.Tables("Masters").DefaultView
    DataGrid1.DataBind()
  End Sub
End Class
