View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bart[_7_] Bart[_7_] is offline
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