Cocould not find installable ISAM, installableisam
The program to read the EXCEL document, has been referred to the "Asp.net read Excel file 2" http://www.cnblogs.com/insus/archive/2011/05/05/2037808.html
This connection statement or method.
However, during this development, an exception occurs when you reference it again:"Cocould not find installable ISAM".
Strange!
After some materials and modifications, Insus. NET slightly changed the code:
The program can run again...
Public static string ExcelConnectionString (string filePhysicalPath) {string connectionString = string. empty; string fileExtension = filePhysicalPath. substring (filePhysicalPath. lastIndexOf (". ") + 1); switch (fileExtension) {case" xls ": connectionString = String. format ("Provider = Microsoft. jet. OLEDB.4.0; Data Source = {0}; Extended Properties = \ "Excel 8.0; HDR = YES; IMEX = 1 \" ", filePhysicalPath); break; case" xlsx ": connectionString = String. format ("Provider = Microsoft. ACE. OLEDB.12.0; Data Source = {0}; Extended Properties = \ "Excel 8.0; HDR = YES \" ", filePhysicalPath); break;} return connectionString;} Source Code