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 ?

Recommended Answers

All 2 Replies

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.

Thanks, I have solbve the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.