When importing an Excel table, the system prompts "The installable isam is not found"

Source: Internet
Author: User

Resources on the network:

C # reading ExcelCode:

View sourceprint?
01 String Strconn ="Provider = Microsoft. Jet. oledb.4.0; Data Source =" + Filepath +"; Extended properties = 'excel 8.0; HDR = no; IMEX = 1 ';";// Cannot be 11.0
02 Oledbconnection conn =New Oledbconnection (strconn );
03 Conn. open ();
04 String Strexcel ="Select * from [sheet1 $]";
05 Oledbdataadapter da =New Oledbdataadapter (strexcel, strconn );
06 Dataset DS =New Dataset ();
07 Try
08 {
09 Da. Fill (DS );
10 }
11 Catch (Exception ex)
12 {
13 Throw New Exception ("Failed to read Excel :"+ Ex. Message );
14 }
15 Return DS;

If "installable isam is not found" is prompted, there are two solutions through Google:

1. connection string Problems

View sourceprint?
1 Extended properties ='Excel 8.0; HDR = no; IMEX = 1'

// HDR indicates whether to use the first row as the data or column name, HDR = No as the data, and HDR = yes as the column name; IMEX = 1 is used to read the hybrid type as the text type to avoid null values.

The left and right single quotes of the above sentence cannot be less

2. You only need to register an Excel isam.

Enter regsvr32 c: \ windows \ system32 \ msexcl40.dll in the "run" dialog box.

C # Read the Excel Code:

View sourceprint?
01 String Strconn ="Provider = Microsoft. Jet. oledb.4.0; Data Source =" + Filepath +"; Extended properties = 'excel 8.0; HDR = no; IMEX = 1 ';";// Cannot be 11.0
02 Oledbconnection conn =New Oledbconnection (strconn );
03 Conn. open ();
04 String Strexcel ="Select * from [sheet1 $]";
05 Oledbdataadapter da =New Oledbdataadapter (strexcel, strconn );
06 Dataset DS =New Dataset ();
07 Try
08 {
09 Da. Fill (DS );
10 }
11 Catch (Exception ex)
12 {
13 Throw New Exception ("Failed to read Excel :"+ Ex. Message );
14 }
15 Return DS;

If "installable isam is not found" is prompted, there are two solutions through Google:

1. connection string Problems

View sourceprint?
1 Extended properties ='Excel 8.0; HDR = no; IMEX = 1'

// HDR indicates whether to use the first row as the data or column name, HDR = No as the data, and HDR = yes as the column name; IMEX = 1 is used to read the hybrid type as the text type to avoid null values.

The left and right single quotes of the above sentence cannot be less

2. You only need to register an Excel isam.

Enter regsvr32 c: \ windows \ system32 \ msexcl40.dll in the "run" dialog box.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.