Click here to Skip to main content
15,919,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                    "Data Source=" + "D:\\SubjectMaster.xls" + "; Jet OLEDB:Engine Type=5;" +
                                                 "Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1\";";

                                        (OR)

strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                    "Data Source=" + "+textBox1.Text+" + "; Jet OLEDB:Engine Type=5;" +"Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1\";";





I am using the above connection string for my application.

Error : Could not find the installed ISAM

I installed Msexecl40.dll also.

can anyone help me to solve this problem.
Posted

1 solution

Normally, this is an indication that your connections string is wrong: try removing the "Jet OLEDB:Engine Type=5;" part and see if it goes away.
 
Share this answer
 
Comments
Karthik Achari 20-Feb-14 4:11am    
Again same error was occured
Karthik Achari 20-Feb-14 4:26am    
OleDbConnection cnCSV = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + textBox1.Text + "; Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1\";");

when i use this connection string and click on import button.It clears the data from grid view.

Can you help me to solve this issue.
OriginalGriff 20-Feb-14 4:38am    
That you called it an "import button" may be significant here - I'm just guessing that it reads data, but doesn't find any. So it clears the existing data and replaces it with empty space...
Karthik Achari 20-Feb-14 4:42am    
private void button2_Click(object sender, EventArgs e)
{

OleDbConnection cnCSV = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + textBox1.Text + "; Extended Properties=\"Excel 8.0;HDR=NO;IMEX=1\";");
//OleDbConnection cnCSV = new OleDbConnection(strConnectionString);
OleDbDataAdapter das = new OleDbDataAdapter("Select *from [Sheet1$]", cnCSV);
DataSet da = new DataSet();

das.Fill(da);
dataGridView1.DataSource = da;

}

This is the code what i have used for my application.
OriginalGriff 20-Feb-14 4:58am    
Yes - and it deletes all the existing data in your DGV and replaces it with everything it read from the file.
So the next thing to do is start looking at the data file.
I use very similar code (except mine is for XLSX files and uses Excel 12) and it works fine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900