0

Hi All,
I downloaded the example with SQL db for filtering from the adres below
http://www.eggheadcafe.com/tutorials/aspnet/c67c4daa-83c2-4baa-aea4-2c8855527acb/aspnet-gridview-filtering-with-dropdownlist.aspx

And when I tried to run it from VS2008, I got this error
"The connection name 'NorthwindConnectionString' was not found in the applications configuration or the connection string is empty"

I already downloaded msi setup Northind database for SQL (2000 version, but I know this does not matter).

I got some questions,

and there is no sql related code in web.config. Do I need it define in web.config file ??

there are some conneciton strings in the aspx code like this one,

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" 
            SelectCommand="SELECT [CompanyName], [ContactName], [ContactTitle], 
            [Country], [Phone], [Address], [City] FROM [Customers]">
        </asp:SqlDataSource>

Is that enough ? I mean is that will be enough for this code to get work out ?

Edited by __avd: Added [code] tags.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by johny2011
0

Hi,

No web.config is found in the sample project downloaded from the above link.

You need to add a web.config and add connection string as below:

<connectionStrings>
   <add name="NorthwindConnectionString" connectionString="Data Source=serverName;Initial Catalog=Northwind;User ID=userName;Password=password" providerName="System.Data.SqlClient"/>
</connectionStrings>

You need to specify the correct server name, database, user id and password etc in the connection string.

Edited by Ramesh S: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.