|
Updated 11/11/2004 The following instructions are designed to work on your home computer. If you’re using a network in your college’s computer lab, ask your classroom instructor or network adminstrator for specific instructions on running the book’s sample programs. Click here if you are a network adminstrator for a college computer lab. Step 1: Run the Setup.exe program
Step 2: Install the Database Server
Step 3: Attach the Databases
Step 4: Install Internet Information Services (IIS)You must install Internet Information Services (IIS), supplied with the following operating systems: Windows 2000 Professional, Windows 2000 Server, Windows XP Professional, Windows XP Server, and Windows 2003 Server. Click here for detailed instructions. Step 5: Create IIS Application DirectoriesClick here to see how to create the IIS application directories you need when running the ASP.NET applications from chapters 7, 8, 9, and 10.
You're All done!
Attach the Databases (SQL Server 2000)In this step you will attach several SQL server files to your SQL Server 2000 server. Every computer using Microsoft Windows has a machine name. SQL Servers are usually named after their local computer's machine name, and you can use the name (local) as a default local server name. The following instructions will assume your server uses (local). Double-click on the file named attach.bat, located in the c:\vbdata directory (the default install directory for the book's CDROM). If you have installed the CDROM somewhere else, look for attach.bat there. You should see a series of messages indicating that four databases have been attached to your server (Campus, KayakStore, SportsRental, and Pubs). Ignore the warning message saying that Pubs is already attached. Different Server Name?If you see error messages indicating the databases were not attached correctly, your server name may be different from your computer's machine name. Look for the SQL Server Service Manager icon on the right side of your computer's Task Bar (at the bottom). Open it, and look for the name next to Server. That will be your server's name. Open a Command window (select Run from the Start menu, enter cmd, click OK). Type the following command (where servername) is your SQL server's name: attach servername Hopefully, your server will be found, and the four databases will be attached. To verify success, open Enterprise Manager (a utility that is part of SQL Server 2000) and look for the new database names.
Can't find the data files?If your database files were not found, you might not have installed the CDROM in the c:\vbdata directory. If your files are somewhere else, you'll have to edit the file named attach.txt, and change the paths of the data files listed there. For example, here is the information for the KayakStore database, which assumes it is located in the c:\vbdata directory: EXEC sp_attach_db @dbname = N'KayakStore',
@filename1 = N'c:\vbdata\KayakStore_Data.mdf',
@filename2 = N'c:\vbdata\KayakStore_Log.ldf'
GO
Suppose you installed the CDROM in the c:\advancedVB directory. Then the corresponding entry in attach.txt would be: EXEC sp_attach_db @dbname = N'KayakStore',
@filename1 = N'c:\advancedVB\KayakStore_Data.mdf',
@filename2 = N'c:\advancedVB\KayakStore_Log.ldf'
GO
Maybe installing the CDROM in its default location wasn't such a bad idea, after all. ;-)
Attach Databases (MSDE)Open a Command window: Select Run from the Start menu, and run the cmd.exe program. When the Command window appears, execute the following commands: c: chdir \vbdata attach (local)\NETSDK Open Visual Studio .NET and open the Server Explorer window. Expand Servers, expand SQL Servers, and expand the entry under <machine>\NETSDK, where <machine> is your computer name. You should now see four new databases: Campus, KayakStore, Pubs, and SportsRental. Different Server Name?If you see error messages indicating the databases were not attached correctly, your server name may be different from your computer's machine name. Look for the SQL Server Service Manager icon on the right side of your computer's Task Bar (at the bottom). Open it, and look for the name next to Server. That will be your server's name. Open a Command window (select Run from the Start menu, enter cmd, click OK). Type the following command (where servername) is your SQL server's name: attach servername Hopefully, your server will be found, and the four databases will be attached. To verify success, open Server Explorer in Visual Studio .NET and look for the new database names. Can't find the data files?If your database files were not found, you might not have installed the CDROM in the c:\vbdata directory. If your files are somewhere else, you'll have to edit the file named attach.txt, and change the paths of the data files listed there. For example, here is the information for the KayakStore database, which assumes it is located in the c:\vbdata directory: EXEC sp_attach_db @dbname = N'KayakStore',
@filename1 = N'c:\vbdata\KayakStore_Data.mdf',
@filename2 = N'c:\vbdata\KayakStore_Log.ldf'
GO
Suppose you installed the CDROM in the c:\advancedVB directory. Then the corresponding entry in attach.txt would be: EXEC sp_attach_db @dbname = N'KayakStore',
@filename1 = N'c:\advancedVB\KayakStore_Data.mdf',
@filename2 = N'c:\advancedVB\KayakStore_Log.ldf'
GO
Maybe installing the CDROM in its default location wasn't such a bad idea, after all. ;-) Detaching a DatabaseVisual Studio Server Explorer doesn't havea command to detach databases. Instead, you must run the OSQL utility. Close Visual Studio .NET, and open a Command window. Execute the following to detach the database named <name>: osql -E -S (local)\NETSDK exec sp_detach_db @dbname = '<name>' go For example, the following EXEC command detaches the Campus database: exec sp_detach_db @dbname = 'Campus' Open Server Explorer in Visual Studio .NET again to verify that the database has been removed. Detaching a database does not delete the files holding the data. You can reattach the database files at a later time if you wish. Running Two Servers on the Same ComputerIn the unlikely case that you have installed both SQL Server 2000 and MSDE on the same comaputer (as the authors have), you must temporarily stop the SQL SERVER 2000 instance before trying to attach any shared database files to your NETSDK server.
Install SQL Server 2000If you have SQL Server 2000 and have not installed it already, run its setup program. During setup, you will be asked for the authentication mode, user name, and password. Here are the default values we use in the book:
If your computer runs on a network, your system administrator will probably require different values for the user name and password.
Install Microsoft SQL Server Desktop Engine (MSDE)If you do not have SQL Server 2000, you can use the Micrsoft SQL Server Desktop Engine (MSDE) instead. Open the \Setup\MSDE folder in your installed Visual Studio .NET directory. For example, the full pay may be c:\Program Files\Microsoft Visual Studio .NET 2003\Setup\MSDE. Double-click on either setup.exe or msde_readme.htm. The latter will guide you to a directory on the Microsoft Web site where you can download MSDE (currently about 70 MB). Instructions for Version: Service Pack 3aMSDE stands for Microsoft SQL Desktop Engine. It's a free substitute for SQL Server that works well with Visual Studio .NET. Currently, the download link is: http://go.microsoft.com/fwlink/?linkid=13962 (This link may change.) After downloading MSDE from the Microsoft Web site, dDouble-click its .exe file to extract all files required to install MSDE on your computer. (Currently, the file is named sql2ksp3.exe.) After extracting the MSDE installation files, open a Command window: Select Run from the Start menu, and run the cmd.exe program. When the Command window appears, execute the following commands, pressing Enter at the end of each line: c: chdir \sql2ksp3\MSDE To install a default instance configured to use Windows Authentication Mode, execute: setup INSTANCENAME="NETSDK" SAPWD="mypassword" Substitute your own password for "mypassword". For example: setup INSTANCENAME="NETSDK" SAPWD="xxy123"
Installing Internet Information ServicesUse the following steps in Windows XP Professional to install Internet Information Services:
(Similar commands can be used for the other versions of Windows listed
above.)
Create IIS Application DirectoriesAssuming you will be loading and running the programs from chapters 7
through 10 in Visual Studio .NET, you must identify each ASP.NET application
folder as an Web application. This is done using the Internet Information
Services Admistrator program. The following instructions show how to run
the program and modify a Web folder.
Step 2. In the Computer Management window, expand Services and Applications, expand Internet Information Services, expand Web Sites, and expand Default Web Site:
Step 3. Perform the following steps for each of the folders copied from the CD-ROM's Ch07-10 directory: (a) Right-click on the folder and click Properties (our sample shows the folder named Cool):
(b) In the Properties dialog box, select the Directory tab:
(c) Click on Create in the Application Settings section. Notice that the Application name is the same as the folder name:
(d) Click OK. After creating the IIS application folders, you can run each of the applications
by clicking on the following hyperlinks: Instructions for Network AdminstratorsMS-Access DatabasesEach student needs read/write access to the following MS-Access databases:
company.mdb, concert.mdb, SalesStaff.mdb, and karate.mdb. SQL Server Databases
|
|