i want to load an excel file into datagridview
here is my connection string
string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", myExcelAddress);
i have office 2007 installed on my pc
it run fine on visual studio 2008 whitout any error but when i write this code in my application in 2010 and wpf, it has this error!!!
what can i do?
please suggest me
Bahar JalaliPosted Jan 16, 2012, 1:23 AM
Bahar JalaliPosted Jan 16, 2012, 1:20 AM
Jignesh TrivediPosted Jan 15, 2012, 11:47 PM
please verify that you must install data connetivity component runtime for reading excel file.
for same please refer
http://www.connectionstrings.com/excel-2007
http://msdn.microsoft.com/en-us/library/ms141013.aspx
http://www.codeproject.com/KB/database/ReadExcel07.aspx
hope this help.
VulpesPosted Jan 15, 2012, 6:57 AM
Under the project's properties, Build tab, I'd try changing the target platform to x86 and then rebuilding it.