This project is read-only.

Which connection string to use for TheBeerHouse Database

Apr 24, 2010 at 11:01 PM


I'm trying to get started with TheBeerHouse project BeerHouse-VB-3.5 in VS2008, SP1 and SQL Server Management Express.

I see a lot of problems of people not able to open the database.  There are a lot of suggestions to modify the connection string.

My questions are which connection string and in which web.config?

There are two web.config files.  One in the BeerHouse35 and another in TBHBLL.

Inside both web.config files there are two connection strings.  One for TheBeerHouseEntities and the other for for LocalSqlServer.

I'm asking all this because I have tried numerous changes to the web.configs to resolve this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

here is my latest connection string from the web.config in BeerHouse35.

<font size="2" color="#0000ff">



add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=True;" providerName="System.Data.SqlClient"


Any help would be gratefully appreciated.



Apr 25, 2010 at 7:40 PM

So the one connection string, for the entities, is for Entity Framework. The other connection string is for the ASP.NET membership provider. The membership provider DOES not use entity framework, so it has a completely diffferent connection string. Entity Framework uses a modified version of the connection string in that it adds a lot of META data. So the error message you are getting should tell you the path you have setup in your connection string (the one pictured above is for the membership provider) is not valid.

Apr 26, 2010 at 9:45 AM

Hello docluv.

Thanks for your reply.  I have since resolved this problem.

I guess when i need to change the connection string, i should change the "LocalSqlServer" connection string in the BeerHouse35/ web.config file?