Wednesday, July 11, 2012

SIMPLE oledb FILL Gridview connectionstring

Imports System.Data.OleDb
Imports System.Data


        Dim cn As New oledbConnection
        Dim ds As New DataSet
        Dim da As New oledbDataAdapter
 cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|bupdate.mdb")

        Dim cm As New OleDbCommand("select * from bupdate", cn)
        da = New oledbDataAdapter(cm)
        da.Fill(ds)
        GridView1.DataSource = ds.Tables(0)
        GridView1.DataBind()

No comments: