473,321 Members | 1,667 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,321 software developers and data experts.

Enterprise Library and reading an Excel file

Enterprise Library January 2006
Visual Studio 2005
Lanugage: C#

I am attempting to use the Enterprise Library to read data from an
Excel spreadsheet file. I got the following connection string from
connectionstrings.com:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended
Properties="Excel 8.0;HDR=Yes;IMEX=1"

But when I use this with the Enterprise Library, it generates an
exception that the Provider keyword is not valid. Here is the text of
the exception:

System.ArgumentException
Keyword not supported: 'provider'.: at
System.Data.Common.DbConnectionOptions.ParseIntern al(Hashtable
parsetable, String connectionString, Boolean buildChain, Hashtable
synonyms, Boolean firstKey)
at System.Data.Common.DbConnectionOptions..ctor(Strin g
connectionString, Hashtable synonyms, Boolean useOdbcRules)
at System.Data.SqlClient.SqlConnectionString..ctor(St ring
connectionString)
at
System.Data.SqlClient.SqlConnectionFactory.CreateC onnectionOptions(String
connectionString, DbConnectionOptions previous)
at
System.Data.ProviderBase.DbConnectionFactory.GetCo nnectionPoolGroup(String
connectionString, DbConnectionPoolGroupOptions poolOptions,
DbConnectionOptions& userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionStri ng_Set(String
value)
at System.Data.SqlClient.SqlConnection.set_Connection String(String
value)
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas e.CreateConnection()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas e.OpenConnection()
at
Microsoft.Practices.EnterpriseLibrary.Data.Databas e.ExecuteReader(DbCommand
command)

Can anyone provide me with some guidance in using the Enterprise
Library to read an Excel file correctly? I can use it no problem with
SQL Server.

The Excel file in question has only 5 columns, all integer type. I
wish to read the data from this file and insert it into a sql table.
Import won't work as this will have to be done on a regular basis and
there is some simple calculations that need to be performed.

Any help is appreciated.

Thanks,

Chris

Oct 20 '06 #1
0 2708

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

Similar topics

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...
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...
0
by: hhravn | last post by:
I am in need of reading the configuration file used by the enterprise logger directly, to get the current minimum logging priority. Could anyone give me some pointers on how to get this value? ...
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...
7
by: rockdale | last post by:
hi, I just downloaded Microsoft Enterprise Library Jan 2006 and try to integrate it into my asp.net application. As i am going to connect to mySQL database, I need to include the source code in my...
2
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I am trying to add multiple connection strings in my web.config file. I searched in google to find out how to add multiple connections strings through enterprise library 2.0 ,...
0
by: =?Utf-8?B?YW5rMmdv?= | last post by:
Hi, Thanks in advance for reading this. Not sure where to post this question, but I hope someone in here can help. Trying to write to Event Log in VS 2005 (.NET 2.0) using Enterprise Library...
0
by: John | last post by:
Hi, I was wondering if it is possible to get the enterprise library (EL) 3.x to read/write the settings.settings section of the .config file? Because when you use the settings.settings in an...
8
by: rssd | last post by:
can somebody help me. I'm trying to read some excel files but i'm always getting this error No type library matching "Microsoft Excel" found at D:\Genes_datasets\exp.pl line 4 Win32::OLE(0.16):...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.