var filePath="f:\xx.xlsx"

string connStr = "Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + filePath + ";Extended Properties='Excel 12.0; HDR=Yes; IMEX=1'";

OleDbConnection myConn = new OleDbConnection(connStr);

myConn.Open();

DataTable table = myConn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null); 

var tableName = table.Rows[0]["Table_Name"].ToString();

相关文章:

  • 2021-12-26
  • 2021-11-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-09
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-10-28
  • 2022-12-23
相关资源
相似解决方案