Chapter 34. Primer on Data Access Technologies

<feature><title>In this chapter</title> </feature>

A History of Data Access

Over the past several years, Web sites have evolved into complex Web applications. As Web sites evolved, the consumers of those Web sites evolved as well. We expect more from our Web sites, and a large part of meeting that expectation is providing access to dynamic data.

Microsoft first introduced data access to mainstream Web developers in FrontPage 97 with the inclusion of IDC/HTX. While IDC/HTX allowed Web developers to create data-driven Web pages, it was a far cry from the ease of use necessary to really push data-driven sites into the mainstream. However, when Active Server Pages (ASP) technology was released very soon thereafter, developers finally had a way to build dynamic content quickly.

Many years later, Microsoft unveiled the .NET Framework. The .NET Framework included a new server-side technology called ASP.NET. ASP.NET once again revolutionized Web site development because it finally gave Web designers the toolset they needed to develop Web applications that felt like Windows applications. In fact, many of today’s ASP.NET developers were developers of Windows-based applications just a few years ago.

For more information on the .NET Framework and ASP.NET, see “Using Standard ASP.NET Controls”, p. 495 (Chapter 28).

Note

ASP.NET used to be referred to by Microsoft as ASP+. In fact, the file extension for ASP.NET Web forms is .aspx—the “x” is simply a “+” turned on its side.

Data Access Technologies in Expression Web

Because Expression Web uses ASP.NET 2.0 for data access, many powerful data access tools such as the DataView, the GridView, and other tools are available to you. Using these tools, you can connect to data in a database, in an Extensible Markup Language (XML) file, or even in a sitemap file.

Note

A sitemap file is a special XML file used by ASP.NET to map out the navigation structure of a Web site.

For more information on sitemap files in ASP.NET, see “Using ASP.NET Navigation Controls”, p. 527 (Chapter 29).

For more information on accessing data with ASP.NET, see “Accessing Data with ASP.NET 2.0”, p. 635 (Chapter 35).

I realize that many Web designers are not programmers. In fact, Expression Web is aimed squarely at the designer market and not the programmers among us. However, don’t let that dissuade you from digging into the data access features in Expression Web. You certainly don’t need to be a coder to appreciate and use the features that ASP.NET 2.0 provides to Expression Web.

There are also ASP.NET developers who are more experienced in developing with ASP.NET, and yet they believe it is proprietary and that they are only able to connect to Microsoft database technologies. In fact, while you can certainly use the features in ASP.NET 2.0 to connect to SQL Server and Microsoft Access, you can also use the same tools to connect to Oracle databases, IBM DB2 databases, MySQL databases, and so on. You can connect to all these different data sources using what Microsoft calls the provider model.

ASP.NET 2.0 comes with several providers that allow you to connect to the databases mentioned previously. However, anyone can write a provider and plug it into ASP.NET to allow for extended functionality. For example, if you wanted to write a provider specific to MySQL, one that added some functionality geared toward MySQL databases, you certainly could. You could then use your provider along with all the existing data access functionality in ASP.NET.

Note

It’s not necessary to understand providers to use them. In fact, we’ll use some powerful data access features in the next chapter without going into providers at all.

An in-depth discussion of providers is outside the scope of this book, but if you’d like to dig into the topic and work with a sample provider, Microsoft offers one for download at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcontemplatefiles.asp.

ASP.NET and Other Web Application Platforms

The one drawback to using ASP.NET 2.0 for data access is that not all hosting companies offer hosting with ASP.NET 2.0 support. In fact, many of the less expensive hosting companies host Web sites on Linux or UNIX, and those servers won’t work with ASP.NET 2.0.

Tip

There is an open source movement to create a foundation on which ASP.NET can run on Linux and UNIX Web servers. As of this writing, you can (with some amount of work) get ASP.NET 1.1 working on a non-Windows Web server, but ASP.NET 2.0 is supported only on Windows 2000 and later.

Many of today’s Web designers are drawn to technologies such as PHP because they think PHP is easier to use than ASP.NET. Still others believe that you have to buy the .NET Framework to use ASP.NET 2.0. It is my assertion that both of these positions are flat-out wrong. It is every bit as easy to use ASP.NET as it is to use PHP. In fact, it is actually easier to create robust Web applications with ASP.NET 2.0.

Tip

I’ll give you one more reason to use ASP.NET over PHP: Expression Web doesn’t support PHP. I realize that’s disappointing to many people, but why not use the opportunity to try ASP.NET. You just might like it!

As for those who believe that being an ASP.NET developer is an expensive endeavor, let me say that the .NET Framework is a free download (as is the .NET Framework software development kit (SDK)), and Microsoft provides a feature-rich, professional development environment for creating ASP.NET applications called Visual Web Developer Express Edition, which costs absolutely nothing. If you haven’t yet downloaded a copy of Visual Web Developer Express Edition, you should stop reading right now and do it. You’ll be absolutely amazed that Microsoft is giving away this tool!

Note

We’ll cover using Visual Web Developer Express Edition in Appendix A, but you can go ahead and download it now by visiting http://www.asp.net/downloads/getvwd/default.aspx?tabid=62.

I usually make it a point not to talk about myself much in my books, but I have to let you know that I do approach the topic of ASP.NET with a bias. (After all, I’m an escalation engineer on the ASP.NET team at Microsoft.) Because of my occupation, I believe my bias is a legitimate one. I got to see first-hand the passion and hard work that went into the development of ASP.NET, and I get to see (on a daily basis) the dedication to always improving it and making it the best it can be. ASP.NET 2.0 is a direct result of that hard work, and it’s got some pretty significant wow factor built in.

As you work through the next chapter, I promise you’ll be amazed at what you can do. You’ll find yourself smiling when you see some of the cool data access features available. Hopefully, you’ll find yourself exploring new ways to make your Web site more dynamic and feature-rich.

Lagniappe (lan yap’) n., a gift or bonus: Databases Aren’t Just for Online Spreadsheets

Many Web designers consider data access only for tasks such as presenting data in a tabular form much like a spreadsheet. It doesn’t help much to have grid-type controls so prominent in many Web design applications, but the fact is that data access is for much more than just creating online spreadsheets.

One of the newest trends in Web development is the content management system. A content management system allows a Web designer to update a Web site’s content by browsing to a special page that is somewhat like an online word processor. Content is entered into the page and then saved into a database. That content is then used to feed other Web pages in the site.

Note

Not all content management systems are data-enabled. Some of them dynamically update the actual page instead of storing the content in a database. The latter is more flexible and easier to reuse when a site redesign takes place.

There are plenty of content management systems available that can easily be added to an existing site. It’s also possible to build one yourself with minimal effort. My Web site, Jimco Software (www.jimcosoftware.com), uses an ASP.NET control from Telerik (www.telerik.com) to implement a content management system. Telerik’s r.a.d.editor control is an extremely powerful solution and can be used to create an ASP.NET-based content management system without writing any code at all.

For those of you who are partial to PHP and the open source movement, MODx (modxcms.com) is an excellent content management system. MODx provides a feature-rich content management system and PHP application framework that is easy to use, is well supported, and is free!

Don’t get stuck in the rut of believing that data access is only for dull and dry data presentation. You can use data access technologies to add plenty of exciting and enhancing features to your Web site with very little effort.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.244.216