473,396 Members | 1,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Reading Excel File

I'm having a problem reading data from an Excel file into a dataset. Can
anybody give me an idea of what's happening? I've included the problematic
source and the error message to the end of this message.

TIA

Brad
Here's a snippet of my source code:
//Retrieve data from the Excel spreadsheet file

string myConnectionString;

OleDbConnection myConnection;

OleDbDataAdapter myAdapter;

DataSet myDataSet = new DataSet("XLS");

myConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=" +

FileName + ";Extended Properties=Excel 8.0;HDR=Yes;IMEX=1";

myConnection = new OleDbConnection(myConnectionString);

myAdapter = new OleDbDataAdapter("select * from [Dataset$]", myConnection);

myAdapter.Fill(myDataSet);

myConnection.Close();

return (myDataSet);

}

Here's the Error Message:
"System.Data.OleDb.OleDbException: Could not find installable ISAM.\r\n at
System.Data.OleDb.OleDbConnectionInternal..ctor(Ol eDbConnectionString
constr, OleDbConnection connection)\r\n at
System.Data.OleDb.OleDbConnectionFactory.CreateCon nection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningObject)\r\n at
System.Data.ProviderBase.DbConnectionFactory.Creat eNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup)\r\n at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)\r\n at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)\r\n at
System.Data.OleDb.OleDbConnection.Open()\r\n at
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapte

r.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)\r\n at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at
RD.DBLoad.ERD.CoSo.MeterData.Read() in
F:\\Projects\\DbLoad_Solution\\RD.DBLoad.ERD\\ERD\ \CoSo\\MeterData.cs:line
90"
Sep 8 '06 #1
3 8002
Check this :
http://blogs.wdevs.com/Gaurang/archi...6/15/5112.aspx
Brad wrote:
I'm having a problem reading data from an Excel file into a dataset. Can
anybody give me an idea of what's happening? I've included the problematic
source and the error message to the end of this message.

TIA

Brad
Here's a snippet of my source code:
//Retrieve data from the Excel spreadsheet file

string myConnectionString;

OleDbConnection myConnection;

OleDbDataAdapter myAdapter;

DataSet myDataSet = new DataSet("XLS");

myConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=" +

FileName + ";Extended Properties=Excel 8.0;HDR=Yes;IMEX=1";

myConnection = new OleDbConnection(myConnectionString);

myAdapter = new OleDbDataAdapter("select * from [Dataset$]", myConnection);

myAdapter.Fill(myDataSet);

myConnection.Close();

return (myDataSet);

}

Here's the Error Message:
"System.Data.OleDb.OleDbException: Could not find installable ISAM.\r\n at
System.Data.OleDb.OleDbConnectionInternal..ctor(Ol eDbConnectionString
constr, OleDbConnection connection)\r\n at
System.Data.OleDb.OleDbConnectionFactory.CreateCon nection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningObject)\r\n at
System.Data.ProviderBase.DbConnectionFactory.Creat eNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup)\r\n at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)\r\n at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)\r\n at
System.Data.OleDb.OleDbConnection.Open()\r\n at
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapte

r.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)\r\n at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at
RD.DBLoad.ERD.CoSo.MeterData.Read() in
F:\\Projects\\DbLoad_Solution\\RD.DBLoad.ERD\\ERD\ \CoSo\\MeterData.cs:line
90"
Sep 8 '06 #2

I'd say you want something like this
select * from [Sheet1]

Its the name of the SHEET (bottom left) when you have the excel file open in
the program Microsoft Excel.

Its not the name of the DataSet.


"Brad" <br************@roche.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
I'm having a problem reading data from an Excel file into a dataset. Can
anybody give me an idea of what's happening? I've included the
problematic
source and the error message to the end of this message.

TIA

Brad
Here's a snippet of my source code:
//Retrieve data from the Excel spreadsheet file

string myConnectionString;

OleDbConnection myConnection;

OleDbDataAdapter myAdapter;

DataSet myDataSet = new DataSet("XLS");

myConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=" +

FileName + ";Extended Properties=Excel 8.0;HDR=Yes;IMEX=1";

myConnection = new OleDbConnection(myConnectionString);

myAdapter = new OleDbDataAdapter("select * from [Dataset$]",
myConnection);
>
myAdapter.Fill(myDataSet);

myConnection.Close();

return (myDataSet);

}

Here's the Error Message:
"System.Data.OleDb.OleDbException: Could not find installable ISAM.\r\n at
System.Data.OleDb.OleDbConnectionInternal..ctor(Ol eDbConnectionString
constr, OleDbConnection connection)\r\n at
System.Data.OleDb.OleDbConnectionFactory.CreateCon nection(DbConnectionOption
s
options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
owningObject)\r\n at
System.Data.ProviderBase.DbConnectionFactory.Creat eNonPooledConnection(DbCon
nection
owningConnection, DbConnectionPoolGroup poolGroup)\r\n at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection
owningConnection)\r\n at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)\r\n at
System.Data.OleDb.OleDbConnection.Open()\r\n at
System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand
command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapte

r.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)\r\n at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at
RD.DBLoad.ERD.CoSo.MeterData.Read() in
F:\\Projects\\DbLoad_Solution\\RD.DBLoad.ERD\\ERD\ \CoSo\\MeterData.cs:line
90"


Sep 8 '06 #3
That was exactly my problem! Thanks for saving me the time on google!

Brad
"Tasos Vogiatzoglou" <tv*****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Check this :
http://blogs.wdevs.com/Gaurang/archi...6/15/5112.aspx
Brad wrote:
>I'm having a problem reading data from an Excel file into a dataset. Can
anybody give me an idea of what's happening? I've included the
problematic
source and the error message to the end of this message.

TIA

Brad
Here's a snippet of my source code:
//Retrieve data from the Excel spreadsheet file

string myConnectionString;

OleDbConnection myConnection;

OleDbDataAdapter myAdapter;

DataSet myDataSet = new DataSet("XLS");

myConnectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=" +

FileName + ";Extended Properties=Excel 8.0;HDR=Yes;IMEX=1";

myConnection = new OleDbConnection(myConnectionString);

myAdapter = new OleDbDataAdapter("select * from [Dataset$]",
myConnection);

myAdapter.Fill(myDataSet);

myConnection.Close();

return (myDataSet);

}

Here's the Error Message:
"System.Data.OleDb.OleDbException: Could not find installable ISAM.\r\n
at
System.Data.OleDb.OleDbConnectionInternal..ctor(O leDbConnectionString
constr, OleDbConnection connection)\r\n at
System.Data.OleDb.OleDbConnectionFactory.CreateCo nnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection
owningObject)\r\n at
System.Data.ProviderBase.DbConnectionFactory.Crea teNonPooledConnection(DbConnection
owningConnection, DbConnectionPoolGroup poolGroup)\r\n at
System.Data.ProviderBase.DbConnectionFactory.GetC onnection(DbConnection
owningConnection)\r\n at
System.Data.ProviderBase.DbConnectionClosed.OpenC onnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)\r\n at
System.Data.OleDb.OleDbConnection.Open()\r\n at
System.Data.Common.DbDataAdapter.FillInternal(Dat aSet dataset,
DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand
command, CommandBehavior behavior)\r\n at System.Data.Common.DbDataAdapte

r.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)\r\n at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)\r\n at
RD.DBLoad.ERD.CoSo.MeterData.Read() in
F:\\Projects\\DbLoad_Solution\\RD.DBLoad.ERD\\ERD \\CoSo\\MeterData.cs:line
90"

Sep 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Alliet | last post by:
Hello, I'm having a bit of a problem with ASP and Excel. A client has developed his own program, which calculates alot of financial stuff, in excel. I'm doing his websites and he has requested...
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
1
by: Turner, GS \(Geoff\) | last post by:
> -----Original Message----- > From: siliconwafer > Posted At: 19 August 2005 15:20 > Posted To: c > Conversation: reading an excel file in C? > Subject: reading an excel file in C? > > >...
4
by: Phoebe. | last post by:
Hi, Good Day! Reading 1 excel file into a dataset is fine. How can I read multiple excel with the same data structure into 1 dataset? How can I append those data? Can someone help? Thanks in...
5
by: Scott M. Lyon | last post by:
I've just discovered a bug in some code I wrote a little while ago, and I need you guys' help to fix it. My program imports data from a standard Excel Spreadsheet (just with specific column...
9
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What...
3
by: Bharathi | last post by:
Hi, I got strucked with reading date value from excel file using C#.NET. For Jan-2000 the value I am getting is 36526.0. For all other dates also I am getting some double value like this. ...
1
by: sachinkale123 | last post by:
Hi, I am reading excel file and reading values from that I am using provider As : "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = " + Filename + ";Extended Properties=\"Excel 8.0;Hdr=No;IMEX=1\"";...
1
by: ndedhia1 | last post by:
I was reading in a log file like this that had no milliseconds: QuoteBlockTiming exceeded 1 ms: 1 --- Thu Dec 10 02:01:40 CST 2009 170.137.15.155 Class key = 601650761 block size QuoteBlockTiming...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.