Hi,
I am trying to load excel sheet data into grid using dataset. but I am getting this error "The Microsoft Access database engine could not find the object 'Sheet1$'."
below is the code. could anyone tell me tell where i am doing wrong. the excel sheet I am trying to load already has Sheet1. Also connection string is correct.
oledbConn.Open()
Dim comm As OleDbCommand = New OleDbCommand("Select * from [Sheet1$]", oledbConn)
Dim oleda As New OleDbDataAdapter(comm)
oleda.SelectCommand() = comm
Dim ds As New DataSet()
oleda.Fill(ds)
gdExcel.DataSource = ds.Tables(0).DefaultView
gdExcel.DataBind()
Catch ex As Exception
MsgBox("error", vbInformation)
Finally
oledbConn.Close()