You can't put the name of the file inside DataSource, you just need to put folder name, so use this:
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\vhosts\chowitaliano.com\httpdocs\test\data\;Extended Properties='text;HDR=Yes;FMT=Delimited'")
ore even better, use this (I assumed that your root folder has subfolder test which has subfolder data where your csv file is):
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + MapPath("~/test/data") + "';Extended Properties='text;HDR=Yes;FMT=Delimited'")
kipo
All-Star
16487 Points
2812 Posts
Re: How to search for a value in a csv file and return another value.
Jul 01, 2008 06:25 AM|LINK
You can't put the name of the file inside DataSource, you just need to put folder name, so use this:
ore even better, use this (I assumed that your root folder has subfolder test which has subfolder data where your csv file is):