This project is read-only.

Cannot open database "TheBeerHouseVB"

Topics: Developer Forum, Project Management Forum, User Forum
Oct 4, 2009 at 5:16 AM

Problem with The Beer House 3.5  VB and C# version ( 3 october)

Cannot open database "TheBeerHouseVB" requested by the login. The login failed.


Oct 4, 2009 at 6:42 PM

Have you created, attached, and assigned the appropriate permissions for your database?

If you have not created the database, you can find the script for creating the database at:  \BeerHouseVB\SQL\BeerHouse.sql.

If you don't understand the administrative functions of attaching a database to an instance of SQL Server, granting permissions for that database within SQL Server Management Studio, and assigning the appropriate Windows Access Control List (ACL) permissions to the Windows User Account that the instance of SQL Server that you have attached your database to is running under, I suggest you find resources that explain those processes to you.

Your problem is not specific to TheBeerHouse - this is a general SQL Server administration or asp.net connection string issue(s).

You may have better luck posting this problem at http://asp.net.

 Good Luck!

 

Oct 7, 2009 at 2:37 PM

Even I got the same problem.

I've downloaded the code but I can't find the SQL file for database.

'\BeerHouseVB\SQL\BeerHouse.sql' Dose not exist with this download.

Oct 7, 2009 at 4:38 PM
Edited Oct 7, 2009 at 5:19 PM
vikaskanani wrote:

Even I got the same problem.

I've downloaded the code but I can't find the SQL file for database.

'\BeerHouseVB\SQL\BeerHouse.sql' Dose not exist with this download.

The location of the database has moved to be a separate download. I'm not sure if the current version applies to all releases of BeerHouse35 or not.

Try downloading BeerHouse-db.zip and unzipping it to your \BeerHouse35\App_Data\ folder.

NOTE that you may have to change the INITIAL CATALOG attribute in your connection string.

Oct 7, 2009 at 5:16 PM
Edited Oct 7, 2009 at 5:24 PM
soros26 wrote:

Problem with The Beer House 3.5  VB and C# version ( 3 october)

Cannot open database "TheBeerHouseVB" requested by the login. The login failed.

This message is probably a Sql Server administration issue. Personally, I use Sql Server Management Studio to manage databases.

A simple scenario is to just drop your database in your \App_Data\ folder and set your connection string to something like the following:

<add name="LocalSqlServer" connectionString="Data Source=.;Initial Catalog=TheBeerHouseVB;Integrated Security=True;" providerName="System.Data.SqlClient"/>

1. The above connection string references the default instance of Sql Server. If you have multiple instances of Sql Server running, you may need to change the connection string to the appropriate instance of Sql Server.

 

*** 2. The above connection string references an initial catalog of "TheBeerHouseVB" make sure this matches your database name.  ***

3. What user accout is your application using for Sql Server authentication?

The answer lies in your connection string.  If your connection string includes a user name and password, try logging into Sql Server Management Studio with that user name and password. If this fails, you may need to grant Sql Server login, read, and write permissions to the user account that your application logs in with.

If your connection string is set for integrated authentication, try loggin into Sql Server Management Studio with "Windows Authentication".

 

Oct 9, 2009 at 11:20 PM

Yes!!  It's good!

I copied the database ASPNETDB.mdf and put the line:

<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

And now everything works! Thank you!