Flylib.com

Books Software

 
 
 

Deploying the Survey Application

Deploying the Survey Application

You must follow a few steps to deploy the Survey application on your server:

  1. Start by creating a database named Survey .

  2. Then, restore the database that can be obtained from the Web site. (The page that has a link to this download is www.ASPNET-Solutions.com/Chapter_3.htm.) A SQL Script also is available in the same place—you can use it in SQL Query Analyzer to create the database.

  3. Next , run Visual Studio .NET. Create a project on the server named Survey for a C# project, or SurveyVB for a VB project. You'll have to make sure you select the appropriate (C# or VB) type of ASP.NET project.

  4. Compile the application once it is created.

  5. Now, create a project on the server named TheSurvey for a C# project, or TheSurveyVB for a VB project. Here again, you'll have to make sure you select the appropriate (C# or VB) type of ASP.NET Web Service project.

  6. Compile the Web Service once it is created.

  7. Close the projects in Visual Studio .NET. Not doing so will create a sharing violation for the next steps.

  8. Make sure you have downloaded the zipped projects from the Web site. Unzip them (the Survey/SurveyVB application and the The Survey/TheSurveyVB Web Service) into the default Web site directory (usually c:\inetpub\ wwwroot ). You will be asked if you want to overwrite existing directories—answer Yes.

  9. Open the application project. Check the Global.asax file to make sure that the database connection string matches the connection string for your situation. Compile it. Do the same with the Web Service.

All of this is easy so far, but here's the more difficult part. The application is using a Web Reference to the Web Service on the www.ASPNET-Solutions.com server. That's OK (except that you're using my bandwidth!), but any changes you make to the Web Service will have no effect when your application runs. To fix this, do the following:

  1. Delete the Web Reference in your Survey application.

  2. Add a Web Reference to your Web Service.

  3. Change the references in the code from the class to my Web Service to the class name that wraps your Web Service.

Your Survey application should now be ready to use and ready to modify as you see fit.

Summary

This chapter gives you a starting point for the effective use of ADO.NET. You've learned how to use the SqlConnection, SqlCommand, and SqlDataReader objects. You've also learned how to add parameters to a command and how to call a stored procedure.

A complete and reusable application was introduced to illustrate the ADO.NET topics that were presented. Along the way, best practices and design patterns were presented that will assist you in developing robust applications.

Although this chapter provides 90 percent of what you need for database access, Chapter 4 covers more advanced ADO.NET topics.

Chapter 4. Using ADO.NET: Creating a Technical Support Application

In This Chapter:

  • Ad Hoc Queries

  • The DataAdapter and DataSet Objects

  • The Cache API

  • The HelpDesk Application

  • Extending and Modifying the HelpDesk Application

  • Deploying the HelpDesk Application

This chapter teaches additional ADO.NET techniques that you'll commonly use in application development. Whereas the Survey application in Chapter 3 used stored procedures throughout, this chapter and its featured application uses ad hoc queries. The DataAdapter and DataSet objects are discussed because these are extremely useful and flexible data-access objects. The .NET Cache API can cache data obtained from a database, and this in turn speeds up your application performance.

A ready-to-use HelpDesk application illustrates the topics presented in the chapter. The application uses ad hoc queries instead of stored procedures, and it creates the queries with parametric and string concatenating techniques. The HelpDesk application offers users the capability to post problems they're experiencing for the purpose of seeking a resolution. Because a Web-based technical support solution is less expensive than a phone-based solution, this capability might save your company a lot of money. Users can also search on previously entered problems to find resolutions that have already been posted.

Finally, hints on extending and modifying the HelpDesk application follow. These hints give you ways to adapt an already-useful application to your specific needs. A section covers deployment of the HelpDesk application so that you can easily use it in your Web application.