I've tried using the OleDb interfaces to read a CSV file, but I noticed something weird.
var filePath = @"C:\set2\orders3_1.csv";
var fileDirPath = Path.GetDirectoryName(filePath);
SqlBulkCopy bcp = new SqlBulkCopy("Data Source=.; Initial Catalog=indexer; Integrated Security=SSPI");
OleDbConnection cxn = new OleDbConnection();
cxn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties='text;HDR=Yes;FMT=Delimited(,)';Data Source=" + fileDirPath;
OleDbCommand cmd = cxn.CreateCommand();
cmd.CommandText = string.Format("Select [OrderNumber] from [{0}]", Path.GetFileName(filePath));
cxn.Open();
var rdr = cmd.ExecuteReader();
bcp.DestinationTableName = "PersonTable";
bcp.WriteToServer(rdr);
rdr.Close();
cxn.Close();
When I put the file name as orders3_1.csv
it reads okay. But when I modify the file name to orders3.1.csv
the code runs into an exception saying it cannot find the file...
Is this a known issue with the JET providers?