I have this program where I am trying to upload an excel file and will be shown in my datagridview but i having this error
Additional information: Could not find installable ISAM.
Im new to VB please help me
Here is my code:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Con As System.Data.OleDb.OleDbConnection
Dim ds As System.Data.DataSet
Dim cmd As System.Data.OleDb.OleDbDataAdapter
Con = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source='c:\manpower.xlsx';Extended Properties=cc;")
cmd = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet2$]", Con)
ds = New System.Data.DataSet
cmd.Fill(ds)
DataGridView1.DataSource = ds.Tables(0)
Con.Close()
End Sub
Why are you using OLEDB connection in the first place? Why not sqlConnection?
If you can, use something like this: