I am developing a code to open up a .dbf file and append data to a access database.Here is my code for opening the .dbf file.
This code works fine but it only selects one field obviously.When I try to run the next code it gives me an empty datasetCode:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim constr As String = "Provider=VFPOLEDB.1;Data Source=F:\JUNO4.dbf;Persist Security Info=False;" Dim con = New OleDbConnection(constr) Dim da = New OleDbDataAdapter("Select UNIQUE_ID FROM JUNO4", con) Dim ds = New DataSet() da.Fill(ds) 'Fill data grid dgv.DataSource = ds.Tables(0) da = Nothing ds = Nothing con.Close() con.Dispose() End Sub
this code gives an empty datagrid.Please help me.I dont know whats wrongCode:Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim constr As String = "Provider=VFPOLEDB.1;Data Source=F:\JUNO4.dbf;Persist Security Info=False;" Dim con = New OleDbConnection(constr) Dim da = New OleDbDataAdapter("Select * FROM JUNO4", con) Dim ds = New DataSet() da.Fill(ds) 'Fill data grid dgv.DataSource = ds.Tables(0) da = Nothing ds = Nothing con.Close() con.Dispose() End Sub




Reply With Quote
