Hi All
I have to connect MS Access database to work with VB.Net ,
Even though my codings are correct, iam getting error while worlking
with my PC.
I had shown my codings and the error message below.
Imports System.Data.Ole Db
Public Class Form1
Inherits System.Windows. Forms.Form
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Try
Dim conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;DATA Source=E:\db1.m db;")
Dim cmd As New OleDbCommand("S elect * from Table1", conn)
conn.Open()
Dim da As New OleDbDataAdapte r(cmd)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataS ource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.ToStr ing)
End Try
End Sub
End Class
I have to connect MS Access database to work with VB.Net ,
Even though my codings are correct, iam getting error while worlking
with my PC.
I had shown my codings and the error message below.
Imports System.Data.Ole Db
Public Class Form1
Inherits System.Windows. Forms.Form
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Try
Dim conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;DATA Source=E:\db1.m db;")
Dim cmd As New OleDbCommand("S elect * from Table1", conn)
conn.Open()
Dim da As New OleDbDataAdapte r(cmd)
Dim ds As New DataSet
da.Fill(ds)
DataGrid1.DataS ource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.ToStr ing)
End Try
End Sub
End Class
Comment