T
Thomas M
I'm trying to read from an Access database using an SqlDataSource and
displaying the retrieved data with a DataList, in asp.net 2.
I want to use a relative path to the .MDB file.
However, I get this error:
"The connection name was not found in the applications configuration
or the connection string is empty"
The .aspx file:
<asp:SqlDataSource ID="DataSourceLinks" runat="server"
ConnectionString="<%$ ConnectionStringsBforbLinks %>"
ProviderName="System.Data.Odbc" SelectCommand="SELECT blah
FROM blah">
</asp:SqlDataSource>
<aspataList ID="DataList1" runat="server"
DataSourceID="DataSourceLinks">
</aspataList>
The web.config file:
<appSettings>
<connectionStrings>
<add name="DBForbLinks"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=~/myFolder/myDB.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
</appSettings>
I've removed all the styling-code etc. in the above code.
So, what's wrong?
displaying the retrieved data with a DataList, in asp.net 2.
I want to use a relative path to the .MDB file.
However, I get this error:
"The connection name was not found in the applications configuration
or the connection string is empty"
The .aspx file:
<asp:SqlDataSource ID="DataSourceLinks" runat="server"
ConnectionString="<%$ ConnectionStringsBforbLinks %>"
ProviderName="System.Data.Odbc" SelectCommand="SELECT blah
FROM blah">
</asp:SqlDataSource>
<aspataList ID="DataList1" runat="server"
DataSourceID="DataSourceLinks">
</aspataList>
The web.config file:
<appSettings>
<connectionStrings>
<add name="DBForbLinks"
connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=~/myFolder/myDB.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
</appSettings>
I've removed all the styling-code etc. in the above code.
So, what's wrong?