Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default problem with connecting to excel from asp.net

Hi,

i'm trying to connect to an excel database ('mytable'). With this code, i
get the error: "Keyword not supported: 'provider'".

When i remove 'Provider =' from the connection string, i get the error:
"Keyword not supported: 'microsoft.jet.oledb.4.0; data source'"

This is the aspx file:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %"
SelectCommand="select * from [mytable]" </asp:SqlDataSource
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1"</asp:GridView

the connectionstring in web.config:

<add name="ConnectionString" connectionString="Provider=
Microsoft.Jet.OLEDB.4.0; Data Source =
c:\aspnet\ls4demotest\app_data\ls4demo.xls; Extended Properties=Excel 8.0;"

providerName="System.Data.SqlClient" /

Thanks for help

Bart


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default problem with connecting to excel from asp.net

Try this and modify the data source
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\foldername\workbookname.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""


"Bart" wrote:

Hi,

i'm trying to connect to an excel database ('mytable'). With this code, i
get the error: "Keyword not supported: 'provider'".

When i remove 'Provider =' from the connection string, i get the error:
"Keyword not supported: 'microsoft.jet.oledb.4.0; data source'"

This is the aspx file:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %"
SelectCommand="select * from [mytable]" </asp:SqlDataSource
<asp:GridView ID="GridView1" runat="server"
DataSourceID="SqlDataSource1"</asp:GridView

the connectionstring in web.config:

<add name="ConnectionString" connectionString="Provider=
Microsoft.Jet.OLEDB.4.0; Data Source =
c:\aspnet\ls4demotest\app_data\ls4demo.xls; Extended Properties=Excel 8.0;"

providerName="System.Data.SqlClient" /

Thanks for help

Bart



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem connecting to Analysis Services ln54 Excel Discussion (Misc queries) 1 March 8th 06 05:01 PM
Problem with Pivot table Connecting to SQL 2005 OLAP [email protected] Excel Discussion (Misc queries) 0 December 8th 05 04:14 PM
problem in connecting to winsql reenu tuteja via OfficeKB.com Excel Discussion (Misc queries) 0 March 22nd 05 06:23 AM
Connecting to SQL from Excel Keith La Force Excel Programming 4 March 2nd 05 09:27 PM
Connecting to excel datasheets using C# Narwe Excel Programming 1 November 22nd 04 02:01 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"