By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,376 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,376 IT Pros & Developers. It's quick & easy.

Reading Excel File

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a

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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.