Metallica Setlists Database in ASP.NET
The following is a step-by-step guide on deploying the Metallica Setlists
Database on your machine.
This guide was written by Brian Johnson for CISC-474 Spring 2006. Links
are current as of May 16, 2006.
Install Microsoft Visual Studio 2005 Professional
- As a member of the University of Delaware community, you can obtain a
free academic version of Microsoft Visual Studio 2005 Professional. To do
this, go to www.cis.udel.edu and click
the MSDNAA subscription
link near the bottom of the page.
- You should be directed to the MSDN Academic Alliance Software Center
page. From here, click the Login button. You can log in using
your University of Delaware
EECIS account
(same account you use to login to porsche.cis.udel.edu). Everyone in
CISC-474 should already have an EECIS account.
- After successfully logging in, click the blue button at the top of the
page that says Software. You will want to download the following
products:
- Visual Studio 2005 Professional Edition CD1
- Visual Studio 2005 Professional Edition CD2
You can find them by using the Search dialog box, or you can select them
from the drop-down list box that contains all the available software titles.
Follow the instructions on the web site to complete the download.
- Once you have completed the download, you should have two .ISO files
named "en_vs_2005_pro_cd1.iso" and "en_vs_2005_pro_cd1.iso". The next
step is to make 2 CD-R discs from these .ISO files. If you're not sure
how to do this, you can
read these
instructions.
- Next, insert CD1 into your CD-ROM drive and begin installing the
software. Follow the on-screen instructions to complete the
installation.
Install Web Application Project Updates
- By default, Visual Studio 2005 does not support web application
projects. To enable web application projects, download and install the
Visual Studio 2005 - Update to Support
Web Application Projects. See
this Microsoft
knowledge base article for more information.
- Next, download and install the
Visual Studio 2005 Web Applications Project Model.
Download and Install the Metallica Setlists Database
- Download the ZIP file
containing all of the code.
- Unzip the files to a directory on your machine. I would suggest the
following directory:
- C:\Documents and Settings\%username%\My
Documents\Visual Studio 2005\Projects
Where %username% is your
Windows login name.
- Run Microsoft Visual Studio 2005. From the File menu, choose Open
Project. Select the following file:
- C:\Documents and
Settings\%username%\My Documents\Visual Studio 2005\Projects\Metallica\Metallica.sln
- In the Solution Explorer, double-click the web.config file to open it.
You will need to update ALL INSTANCES of the connection strings so that they
point to the correct location of metallica.mdf. The default connection
string is as follows:
-
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Documents
and Settings\BJ\My Documents\Visual Studio
2005\Projects\Metallica\Metallica\metallica.mdf";Integrated Security=True;Connect
Timeout=30;User Instance=True"
For example, to install this under the pconrad directory under "Documents and Settings"
you might do a global find/replace, replacing \BJ\
with \pconrad\
, given that the original username when Brian Johnson created the application was BJ.
- Now, press Ctrl + F5 to compile and run the program. Microsoft
Visual Studio should start an ASP.NET development server on your machine,
and open your web browser to the default page
(Index.aspx).
- If you receive any build errors or run time errors, check to make sure
your connection strings are set up appropriately.
Working with the database
The image below shows where you click in Visual Studio to get into the database.
Troubleshooting Tips
If you get the error message shown below, it probably means your
connection strings aren't correct. Brian says: "sometime Visual
Studio seems to like to change them on you, so you might fix one of
these, and then it mysteriously reappears. Basically, the default way
to create a database in ASP.NET is to create a database in a certain
directory under the project structure, and I didn't know to do that,
so I didn't do it. So, Visual Studio won't revert to looking under
\BJ\
, but it might revert to looking under that default
directory."
Server Error in '/' Application.
An attempt to attach an auto-named database for file C:\Documents and Settings\pconrad0\My Documents\Visual Studio 2005\Projects\Metallica\Metallica\metallica.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.