|
-
March 21st, 2012, 03:23 PM
#1
Could not find installable ISAM when Filling Adapter
I am trying to get excel sheet data imported to a gridview. I am getting the error "Could not find installable ISAM" when the debugger reaches the ".Fill(dsSurvey);" portion of the code. I am using Windows XP, Office 2007, and the excel file is generated as a .xls file which is Excel 8.0. I have searched the web and installed drivers to try to fix this as microsoft advised but that does not fix it. I have been playing around with the connection string but I am not sure that is where the problem is since it occurs directly at the Fill. To test I tried commenting out the last two lines of the code and rerunning but I get no error so I assume the issue has something to do with the .Fill() line alone and nothing else but I cannot be sure. My code is below:
Code:
public void ImportExcelSh()
{
GrdVwSurvey.Visible = true;
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + flePath + SLASH + fleName + ";" + "Extended Properties=Excel 8.0;HDR=Yes;IMEX=1;ImportMixedTypes=Text;TypeGuessRows=0;";
OleDbCommand command = new OleDbCommand
(
"SELECT PROBLEM ID, DateClosed, Full Name, RESPONSIBLE GROUP, CONTACT EMPLOYEE ID, CONTACT LAST NAME, CONTACT FIRST NAME, CONTACT EMAIL ADDRESS"+
"FROM [DAS Survey$]", conn
);
DataSet dsSurvey = new DataSet();
OleDbDataAdapter surveyAdapter = new OleDbDataAdapter(command);
surveyAdapter.Fill(dsSurvey);
GrdVwSurvey.DataSource = dsSurvey.Tables[0];
}
Last edited by Cimperiali; March 21st, 2012 at 05:32 PM.
Reason: adding [code][/code] tags
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|