Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 19th, 2008, 05:46 AM
Authorized User
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Read data from Ms Excel 2007

hi everybody,

        i want to read data from Ms Excel 2007 . So i used this connection string

    string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;"+"Data Source="+txtFilepath.Text+";"+"Extended Properties=Excel 12.0;";

but it display error :Could not find installable ISAM.

i also installed AccessdabaseEngine.exe

but still display the same error.

please help me





 
Old June 19th, 2008, 09:51 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

A quick search of google reveals that the format for an OleDb connection string to Excel should look like this:

Provider=Microsoft.Jet.OLEDB.12.0;Data Source=Filename;Extended Properties="Excel 12.0";

Could it be that you are confusing yourself with the excessive use of string concatenations? I always find it useful to use String.Format in these instances:

Code:
string connectionString = String.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0\";", txtFilePath.Text);
Or could it simply be the missing quotes around the "Excel 12.0" part?

/- Sam Judson : Wrox Technical Editor -/
 
Old June 19th, 2008, 09:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Or it could be as simply as too many spaces between "Extended" and "Properties".

/- Sam Judson : Wrox Technical Editor -/
 
Old June 21st, 2008, 02:35 AM
Authorized User
 
Join Date: Apr 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you very much,

It is working







Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read data from an excel file diegoblin Beginning VB 6 6 August 31st, 2009 11:04 PM
how to read data from sybase to excel thillaiarasu SQL Language 2 April 20th, 2007 01:34 AM
Java solution Read Mixed data columns from excel. pranjaldutta VBScript 1 March 19th, 2007 12:29 PM
Read Data from Excel File kiwibey ASP.NET 2.0 Professional 1 December 5th, 2006 11:27 AM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.