Exam Reviews

70-305: Web Woes

Knowledge of Web technologies is imperative to your success with Visual Studio .NET. Here’s the exam that’ll help you prove your expertise.

Ever since Microsoft released Visual Studio .NET and the .NET Framework in February 2002, the development community has slowly warmed up to the great new features they offer. Microsoft has reiterated its commitment to the .NET Framework and Visual Studio .NET by releasing a total of six certification exams and one new certification related to .NET. True to its nature, Microsoft hasn't made certification on .NET easy, and it's expecting developers to fully embrace the technology, recommending that candidates have a year of strong development experience before attempting the exams. Exam 70-305, related to Web development with Visual Basic .NET, is considered a core test for the MCSE. Knowledge of Web technologies is imperative to your success with Visual Studio .NET.

Nightmarish Navigation
One of the first things that you must do in developing a Web application is to create a user interface. Of course, this not only concerns the layouts and controls but also takes into account validation of input, using components, and implementing forms of navigation. All of this is certainly possible with ASP.NET, but you have to figure out how to do it! For example, make sure you understand how to use server controls other than the ones included in the .NET Framework. Also very important to the development process is knowing when properties should be set on the controls during design time and when they should be set at runtime. Make sure you know how to do both things.

Next, be sure you can competently use the intrinsic objects included with .NET. If you're an old hand at ASP development, then the Application and Session objects will be familiar to you. As a side note, it's pretty much the same as it was in ASP. Also, remember that the objects are now formally referred to as HttpSession and HttpApplication. This may save you some headaches in the end, especially if you're seeking out documentation on them!

ASP.NET introduces a few new ways to handle state. While we're on the topic of the Session object, it might do us some good to look at some of the new ways that ASP.NET is doing this. Make sure you understand the concept of ViewState. ViewState is the process that ASP.NET uses to store page values in a hidden control for processing on the server side. In layperson's terms, you can only use ViewState to save values within a single page.

Web-Based Apps with
Visual Basic .NET

Exam Title
70-305: Developing and Implementing Web Applications with Microsoft Visual Basic .NET and the Microsoft Visual Studio .NET

Live as of September 2002.

Reviewer's Rating
"Tough but fair, this exam runs the gamut of Web development with .NET technologies. If you know your stuff, you'll pass it."

Who Should Take It
Core or elective exam for .NET MCAD; core exam for .NET MCSD; elective credit for MCDBA on SQL Server 2000.

What Courses Prepare You
Programming with Microsoft ADO.NET, http://www.microsoft.com/

Developing Web Applications Using Microsoft Visual Studio .NET, http://www.microsoft.com/

Exam Guidelines

Another way of managing state with .NET is via SQL Server. In the days of ASP, some sites needed to scale across multiple servers into a Web farm. This presented a big problem, indeed: Session variables can only be maintained across a single server. So application developers created a workaround that would save the session variable to a database table after each request. That way, it didn't matter which Web server you hit with each request—your session data was retrieved from the database. Unfortunately, this entire process had to be programmed manually in ASP—not fun at all. Now, with ASP.NET, we can run a few scripts and modify a configuration file and—voila! It's done. Remember, though, that while this is a great alternative for Web farm scenarios, it is still much more performance-intensive to retrieve data from a database than it is to retrieve from a normal session variable. Be sure to consider this before you implement the solution.

Finally, make certain you know how to implement applications that can be used worldwide. Look at the different kinds of mirroring supported by .NET. Make sure you can deal with issues such as currency and time differences. Remember, just because you can use an application here in the U.S. doesn't mean that everybody else has the same culture or way of doing things!

Tip: Make sure you know the difference between Web user controls and Web custom controls.

Off To See the Wizard…
Components, or assemblies as they're called in Visual Studio .NET, are the building blocks of our applications. Assemblies are made up of classes, which are, in turn, created by the developer to perform a task, whether it's displaying a form or retrieving information from a database. If you don't know how to use .NET components to your advantage, you're toast before you even get out of the gate.

Unfortunately, our experiences with .NET development won't always be like a trip to Oz. There will be no Yellow Brick Road or Emerald City to pass through on our way to the wizard. This means we're going to deal with situations that may get ugly. For example, you may find that you have to use a legacy COM or COM+ component (oh, my!) to achieve your goal. Sometimes there's just not enough time or budget to rewrite absolutely everything the first time. Or perhaps you just have a component that does exactly what you want it to do with no changes. In either case, you need to be familiar with calling these kinds of components from an ASP.NET page.

Also new to Visual Studio .NET is the ability to create Web Services. A Web service is a remote component that can be invoked from literally anywhere. It doesn't matter if the component is right next to you or at another corner of the Earth; its data is just as accessible to you anywhere. Make sure you know how to set Web References to a Web service and then subsequently invoke it from your ASP.NET page or Visual Basic .NET component.

Tip: Make sure you know how to create different kinds of assemblies, such as those that hold resource specific or globalization information.

Deep Data Diving
As I'm sure you're already aware, database interaction is arguably the most important skill a Web developer of any variety can have. Microsoft certainly thinks so, with the extensive coverage this topic received on the version of the exam I took. You need to be aware of all the methods of data retrieval, primarily understanding the differences between the System.Data.OleDbClient and System.Data.SqlClient namespaces. The SqlClient namespace can be used with any version of SQL Server that is later than version 6.5. The OleDbClient namespace can be used by other OLE DB data sources like Access and older versions of SQL Server. Be aware that the OleDbClient namespace performs significantly slower than the SqlClient namespace.

Also very important to .NET data access is the concept of DataSets and DataReaders. A DataSet is the primary unit for data access. It relies on a disconnected model. That is, a DataSet doesn't require an existing and active connection to the database to read and modify data; however, it will need one if data is to be updated. DataReaders do require an open connection but are much more efficient for forward-only operations.

You should also take some time to review the significant amount of support that has been added for XML in Visual Studio .NET. It's possible to use the XmlDataDocument object to synchronize the contents of a DataSet and an XML document. This can provide a significant amount of flexibility in the underlying data models you can use. Also know that SQL Server 2000 can produce a query response in XML with the FOR XML clause in a SQL query. You should review how to write these types of queries and when they would be useful.

Finally, make sure that once you've retrieved the appropriate data, you can bind it to the correct controls. Familiarize yourself with the DataSource property and DataBind method of Web controls. Also, if your data source is a DataSet object and the DataSet has more than one table, you'll need to use the DataMember property to specify which table in the DataSet is going to be the data source for the control.

Tip: Review your stored procedure writing skills and make sure you can call a stored procedure with ADO.NET code.

Squish Those Bugs
During the process of development, you'll need to familiarize yourself with the different tools that are used in Visual Studio .NET to debug code. While there are some similarities from Visual Studio 6.0, don't be fooled! Not everything is the same! Making appearances from Visual Studio 6.0 are the Watch Window and the Immediate Window. They do exactly the same things that they did before. The Immediate Window allows you to retrieve the value of a variable while at a breakpoint during runtime. The Watch Window allows you to set a defined value of a variable and specify that a specific condition execute when that value is achieved. For example, you may have a very long loop in your code and want to stop execution when your variable's value hits 10,000.

Unlike the original version of ASP, ASP.NET debugging is actually easy to configure. In fact, once Visual Studio .NET is installed, you'll have complete ASP.NET debugging functionality. Note that you need access to an IIS server for this to happen. Also, remember that you won't need to modify any IIS settings to enable debugging; the settings in the IIS configuration pages are for ASP, not ASP.NET! Don't fall prey to this trick!

Finally, you have the option of enabling tracing in an ASP.NET application. This can be done on a machine-wide, application-wide, or page-wide scope. Don't enable tracing on a production site unless you have some serious power on the servers—it takes up many system resources. Tracing allows you to see the exact execution of code as each page on a site loads. This may be necessary when attempting to track down difficult-to-find or sporadic bugs that may occur on your site.

Tip: Review writing errors to the Windows Event Log on Windows 2000 and XP machines.

The Running of the Code
Once the application is pristine and bug-free (yeah, right!), you can deploy it to a production server. Visual Studio .NET includes a bunch of nice tools for deployment. You could, for example, create a Windows Installer file (.MSI) to install your components and Web files. The nice thing about deployment, however, is that you can simply copy the files to a directory in IIS, mark that directory as an application, set permissions if you need to, and you're all done! You don't have to worry about registering components unless you have COM or COM+ components to deal with. That's it!

Also, make sure you compile your ASP.NET application in release mode before you copy the application to your production server. This is important to ensure that all the information needed is compiled into your assembly and you don't have to deal with the costly debug symbols in there. When you copy the Web application out to the Web server, all you should need are your ASPX files and your compiled DLL. Don't copy the .vb source files to the production server. If you do, they'll be available for download, thus allowing everybody in the world to know what's in your application!

It's also important to make sure you understand the importance of the web.config and machine.config files. The web.config file can contain information that is specific to your Web application, while the machine.config file specifies information on the overall .NET configuration of your machine. The web.config file is useful for storing information like connection strings and directory paths to be used by your application when necessary.

These files can also be used to specify the security settings of your Web application. You can choose from Windows, Forms and Passport authentication. Windows Authentication uses Windows accounts to allow access. You must simply set the permissions that you want each user to have in the web.config file, and they'll be permitted or denied based on those settings. There can be multiple levels of web.config files in different directories and understanding how they interact is important. Forms authentication uses a default form that you specify. If a user isn't authenticated and you make an authentication request for credentials, they're redirected to the forms page for login. Finally, there's Microsoft's Passport authentication, which allows you to use Passport technology. This is an expensive fee-based service, however, and not all organizations will be able to implement it.

10 Things To Practice
  1. Create a basic login form. Make a Web user control out of it and place it on different pages to test its functionality.

  2. Retrieve data from a SQL Server database with a FOR XML statement.

  3. Write an ASPX page that uses a DataGrid control. Bind the DataGrid control to both a SqlDataReader and a DataSet. Note the differences.

  4. Create a simple ASPX page that has a loop that counts to 1,000,000. Use the Watch window and Immediate window to view the values of the variables as the loop completes.

  5. Using the System.Configuration namespace and the web.config file, add a file path to the web.config file and read it from an ASPX page.

  6. Enable tracing on an individual page and view the results. This page should probably retrieve data or do something mildly intensive.

  7. Enable SQL Server session state. Make sure it works appropriately.

  8. Create a simple Web service. Invoke the Web service from an ASPX file.

  9. Invoke a COM+ component from an ASPX file. You may need Visual Studio 6.0 to write a basic component in VB.

  10. Use the ASP.NET validation controls to perform form validation on a custom ASPX form. Handle validation errors in the code.

(Exam objectives can be found at www.microsoft.com/traincert/exams/70-305.asp.)

Wrapping It Up
The Visual Basic Web exam isn't too bad if you've been working with most aspects of Visual Studio .NET for a while. Get some solid experience building Web applications, then spend time studying the details of concepts you may not work with much. That's your route to acing this test. Good luck!


comments powered by Disqus

Subscribe on YouTube