hi i have this code which will try to get data from a csv file and then transfer it to a DataSet...
but im getting this exception when i try to open the connection
System.Data.OleDb.OleDbException = {"Could not find installable ISAM."}
need help... Tnx...
heres my code..
Private Function GetCSVFile(ByVal pathName As String, ByVal fileName As String) As DataSet
Using excelConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathName + ";Extended Properties=Text;HDR=Yes;FMT=Delimited")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM " + fileName, excelConn)
Dim excelAdpter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Try
excelConn.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim DS As DataSet = New DataSet
excelAdpter.Fill(DS)
excelConn.Close()
Return DS
End Using
End Function
but im getting this exception when i try to open the connection
System.Data.OleDb.OleDbException = {"Could not find installable ISAM."}
need help... Tnx...
heres my code..
Private Function GetCSVFile(ByVal pathName As String, ByVal fileName As String) As DataSet
Using excelConn As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathName + ";Extended Properties=Text;HDR=Yes;FMT=Delimited")
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM " + fileName, excelConn)
Dim excelAdpter As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Try
excelConn.Open()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Dim DS As DataSet = New DataSet
excelAdpter.Fill(DS)
excelConn.Close()
Return DS
End Using
End Function