title: CSV is actually .... Semicolon Separated Values ... (Excel export on AZERTY)
body: <p>I'm a bit confused here.</p>
  
  <p>When I use Excel 2003 to export a sheet to CSV, it actually uses semicolons ...</p>
  
  <pre><code>Col1;Col2;Col3
  shfdh;dfhdsfhd;fdhsdfh
  dgsgsd;hdfhd;hdsfhdfsh
  </code></pre>
  
  <p>Now when I read the csv using Microsoft drivers, it expects comma's and sees the list as one big column ???</p>
  
  <p>I suspect Excel is exporting with semicolons because I have a AZERTY keyboard. However, doesn't the CSV reader then also have to take in account the different delimiter ?</p>
  
  <p>How can I know the appropriate delimiter, and/or read the csv properly ??</p>
  
  <pre><code>    public static DataSet ReadCsv(string fileName)
      {
          DataSet ds = new DataSet();
          string pathName = System.IO.Path.GetDirectoryName(fileName);
          string file = System.IO.Path.GetFileName(fileName);
          OleDbConnection excelConnection = new OleDbConnection
          (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pathName + ";Extended Properties=Text;");
          try
          {
              OleDbCommand excelCommand = new OleDbCommand(@"SELECT * FROM " + file, excelConnection);
              OleDbDataAdapter excelAdapter = new OleDbDataAdapter(excelCommand);
              excelConnection.Open();
              excelAdapter.Fill(ds);
          }
          catch (Exception exc)
          {
              throw exc;
          }
          finally 
          {
              if(excelConnection.State != ConnectionState.Closed )
                  excelConnection.Close();
          }
          return ds;
      } 
  </code></pre>