Try this one :
Dim objda As OleDbDataAdapter= New OleDbDataAdapter
Public con As New OleDb.OleDbConnection
Dim objdataset As DataSet = New DataSet
Dim dv As DataView
objda.SelectCommand = New OleDbCommand
OpenConnection()
objda.SelectCommand.CommandText = "Select * FROM TableName"
objda.Fill(objdataset, "TableName")
dv = New DataView(objdataset.Tables("TableName"))
DataGridView1.DataSource = dv
Public Sub OpenConnection()
If con.State = ConnectionState.Open Then
con.Close()
End If
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.StartupPath & "\DataBaseName.mdb;Persist Security Info=True;"
Try
con.Open()
Catch ex As Exception
MessageBox.Show("Uable to Connect", "Database Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End
End Try