Reading Excel Chinese table names using OleDbConnection RRS feed

  • Question

  • I have an Excel xls file which contains Chinese table names. I use OleDbConnection to obtain the table names, and get "????$", thus cannot use "select * from [Chinese table name]" to read data. But when I open the xls file by Excel 2003 and then run my code, I can read out Chinese table name as "中文表名$" and get data by "select * from [Chinese table name]". I dnn't know why. How can I read Chinese xls file without opening it by Excel? Thank you!

    The code is as follows:

    public static void PrintSchemaTable(string filePath)
     string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties= ""Excel 8.0;HDR=YES;""";
     connectionString = string.Format(connectionString, filePath);
     using (OleDbConnection conn = new OleDbConnection(connectionString))
      DataTable schemaTable = conn.GetOleDbSchemaTable(
       new object[] { null, null, null, "TABLE" });
      DataTable dtSheetName = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "Table" });
      for (int k = 0; k < dtSheetName.Rows.Count; k++)
       string tableName = dtSheetName.Rows[k]["TABLE_NAME"].ToString();
    Sunday, October 17, 2010 3:26 AM


  • If I am not mistaken, there were multiple editions of Jet OLEDB provider to support different locales. I cannot find download for it though. You can try to search for it at

    If that does not work, you can use Excel reader provider from my web site as it supports Chinese and it is native .NET data provider.

    Val Mazur (MVP)
    • Marked as answer by liurong luo Monday, October 25, 2010 1:49 AM
    Monday, October 18, 2010 10:41 AM