Article

Build Your Own ASP.NET Website Using C# And VB.NET, Chapter 1 - Introduction to .NET and ASP.NET

Page: 1 2 3 4 5 6 Next

Installing Microsoft Access

Access is Microsoft's database solution for both developers and small companies who need to house data within a small yet reliable store. Because Microsoft Access is widely available, it's usually the perfect choice for discussion and use within books such as this. Although we won't be covering data access until Chapter 5, Validation Controls, you may want to start thinking about the scope of your or your company's needs and choose a database accordingly. If you're a small company looking for something cheap, reliable, and easy to use, then Access is for you. This book will cover examples using both Access and MSDE. Even if you plan on using MSDE, you may still want to read this section, as Access provides some good data modeling tools that aren't available to you through Web Data Administrator.

You can find more information on Access from the Access Website. Here, you can find the latest updates, news, and purchase information for Microsoft Access.

Access is bundled with Professional editions of the Microsoft Office suite, so you may already have it installed. If you've already installed Microsoft Office on your computer, but didn't install Access at the same time, you'll need to add it to your installation. The following assumes that you have either Microsoft Office 2000 or XP Professional handy, and that you'll be installing from that CD:

  1. Navigate to the Add or Remove Programs menu located within the Control Panel.

  2. Select your Microsoft Office installation from the Programs menu and select Change.

  3. When the Microsoft Office Setup dialog appears, select Add/Remove Features and click Next.

  4. Select Run from My Computer from the Access program menu.

  5. Click Update. You will be prompted to insert your Microsoft Office CD, so make sure you have it handy. Access will now install.

If you plan to purchase Access, you might like to consider purchasing the Microsoft Office bundle, as you receive Access, Word, Outlook, PowerPoint, and Excel for much less than the total cost of each of the components. Installing Access from either the Microsoft Access or Microsoft Office CDs is easy�just insert the CD, follow the onscreen prompts, and accept the default installation.

That's all there is to it. You are now ready to begin working with database-driven Web applications.

Installing SQL Server Desktop Engine (MSDE)

SQL Server 2000 is Microsoft's database solution for medium to large companies and enterprises. It is quite a bit more expensive than Access, generally requires its own dedicated "database server", and, at times, requires the hiring of a certified database administrator (DBA) to maintain; yet it offers a robust and scalable solution for larger Web applications.

I'll assume that if you're reading this book, you probably don't want to invest in something as massive as SQL Server, and that your needs are better suited to something free that's nearly as powerful for testing and development purposes. If this is the case, then Microsoft's SQL Server Desktop Engine, or MSDE, is perfect for you. MSDE is Microsoft's free database alternative to SQL Server. It functions and stores data exactly as SQL Server does, but is licensed for development purposes only.

Once the .NET Framework SDK is installed, installing MSDE is a snap and can be completed as follows:

  1. Select Start > Programs > Microsoft Framework SDK, and choose Samples and QuickStart Tutorials.

  2. Choose the Download and Install the Microsoft SQL Server 2000 Desktop Engine link. You will be redirected to a download page on Microsoft's Website.

  3. Select Step 1: Download the Microsoft SQL Server 2000 Desktop Engine (68.4 MB).

  4. Save the file onto your hard drive. At nearly 70 MB, this may take some time, so you may want to move onto the section called "Your First ASP.NET Page" later in this chapter while the download continues, as our first example doesn't use a database. Once the download is done, come back and continue the installation process.

  5. Double-click the downloaded file and follow the instructions to unpack the MSDE setup files.

  6. Open the Command Prompt by selecting Start > Run; type cmd, and select OK.

  7. Change to the directory to which you extracted the files using cd on the command line. MSDE extracts to C:\sql2ksp3\MSDE by default.

  8. Type the following command (all on one line) in the MSDE directory to set up MSDE:

  9. Setup.exe /qb+ INSTANCENAME=NetSDK DISABLENETWORKPROTOCOLS=1
    SAPWD=PASSWORD

    The complete set of commands is shown in Figure 1.6.

    1323_fig6
    Figure 1.6. Install MSDE by running the command line executable and setting necessary parameters.

    It's a good idea to set a suitable system administrator password using the SAPWD parameter as shown above, although you can apply the traditional blank password by using the BLANKSAPWD=1 parameter instead.

  10. MSDE will now install.

  11. Restart your computer for changes to take effect.

If all goes well, when the computer restarts, you'll notice in the task bar tray a small icon that looks like a cylinder with a play icon on top, as shown in Figure 1.7.

1323_fig7
Figure 1.7. MSDE runs out of sight within the task bar tray.

That icon represents the database Service Manager. It lets you start and stop the database engine; all you have to do is double-click that icon within the task bar tray. Double-click the icon now to open the Service Manager Dialog, where you can select the Play icon to start the service, or the Stop icon to stop the service.

In some cases, you may not see either a green triangle or a red square; instead, you see an empty white circle. When you open Service Manager, you'll see the message "Not Connected" appear in the status bar at the bottom. You'll need to type YourComputer\netsdk in the Server drop-down (where YourComputer is the name of your computer), and click Refresh services. MSDE should then connect, and the green triangle should appear.

Installing and Configuring Web Data Administrator

In order to use MSDE effectively, you'll need some sort of administration tool to work with your databases. Web Data Administrator is another free tool provided by Microsoft that allows you to manage your instance of MSDE locally and remotely using a Web-based interface. You can download this program from Microsoft's developer site. Scroll to the bottom of that page and you'll find two search boxes. Leave the top one at All, and type Web Data Administrator in the bottom one, then click search. The search results should include the correct page.

Once you've downloaded it, simply double-click the .msi file to install. Once installed, Web Data Administrator can be accessed through your browser at the URL http://localhost/SqlWebAdmin, but before it can be used, you'll need to enable what is known as SQL Mixed Mode authentication.

This involves making a small change to the registry, but don't be put off. If you follow these instructions exactly, you won't do any harm. Let's do it! Click Start, then Run�. In the dialog, type regedit and press Enter to open the registry editor. Now expand the HKEY_LOCAL_MACHINE node in the left hand pane, then expand the SOFTWARE node. Next, find and open the Microsoft node, and, inside that, open one labeled Microsoft SQL Server. In there, you should find a node called NETSDK, which contains another, called MSSQLServer. Select that node, and find the key (in the right hand pane) called LoginMode. Double-click that, and change its Value data from 1 to 2, then click OK. Now, close regedit, and restart your computer. Phew! That was a bit of a trek, but I hope you found it easier in practice than it appears on paper!

Now, open the Web Data Administrator URL given above. You'll be asked for the login, password, and server name for your instance of MSDE. Type sa in the user name box, and the password that you supplied during the installation of MSDE. If you're unsure what the name of your server is, double-click the database engine icon within the task bar tray. The name of your server is located within the server drop-down menu.

Once you've done this and clicked Login, you will see a list of the databases that are currently available from MSDE, as shown in Figure 1.8.

1323_fig8
Figure 1.8. Web Data Administrator allows you to work with your databases within MSDE.

More information on Web Data Administrator, MSDE, and databases will be covered in Chapter 6, Database Design and Development.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article

Sponsored Links