Beginning ASP.NET Databases Using VB.NET


What is this book about?

For a web site to offer its users an experience that improves on that of newspapers or textbooks, it needs a way to change the information it contains dynamically - and that means it needs access to a data source. Through the combination of ASP.NET and ADO.NET, Microsoft provides everything necessary to access, read from, and write to a database, and then allow web users to view and ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (18) from $1.99   
  • New (3) from $17.76   
  • Used (15) from $1.99   
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any coupons and promotions
Seller since 2008

Feedback rating:



New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.


Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2014

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Seller since 2014

Feedback rating:


Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Sort by
Sending request ...


What is this book about?

For a web site to offer its users an experience that improves on that of newspapers or textbooks, it needs a way to change the information it contains dynamically - and that means it needs access to a data source. Through the combination of ASP.NET and ADO.NET, Microsoft provides everything necessary to access, read from, and write to a database, and then allow web users to view and manipulate that data from a web browser. In this book, we'll show you how it's done.

What does this book cover?

Packed with clear explanations and hands-on examples, Beginning ASP.NET Databases contains everything you'll need on your journey to becoming a confident, successful programmer of data-driven web sites. In particular, we'll look at:

  • Connecting to common data sources, including SQL Server and MS Access
  • Reading data with data reader and dataset objects
  • Creating and deleting records, and editing data
  • Displaying data with ASP.NET's web server controls
  • Writing and using stored procedures from VB.NET code
  • Placing your data access code in reusable class libraries

The book closes with a real-world case study that consolidates the tutorials throughout the book into a practical result.

Who is this book for?

To use this book, you need a computer running either Windows 2000 or Windows XP Professional Edition. The examples it contains will not run on Windows XP Home Edition.

This book is for people who have some experience of programming ASP.NET with Visual Basic .NET, are familiar with the operation of the .NET Framework, and want to learn how to use ASP.NET to make data-centric web applications. No prior knowledge of database programming is necessary.

Read More Show Less

Product Details

  • ISBN-13: 9780764543753
  • Publisher: Wiley
  • Publication date: 4/22/2003
  • Series: Beginning Series
  • Edition number: 1
  • Pages: 480
  • Product dimensions: 7.40 (w) x 8.84 (h) x 1.06 (d)

Meet the Author

Jesudas Chinnathampi, also known as Das, is working with Active Server Pages since 1998. Currently he is working with Silicomm Corporation, Das is also a member of the ASPElite, a select group of developers who help to manage the discussions at Das started working with ASP .NET since the first Beta.
He has a Masters Degree in Computer Application. During leisure time, he enjoys driving, playing chess and watching games (Cricket, Basketball, Shuttle Badminton). You can reach Das at

Fabio Claudio Ferracchiati is a software developer and technical writer. In the early years of his ten-year career he worked with classical languages and old Microsoft tools like Visual Basic and Visual C++. After five years he decided to dedicate his attention to the Internet and related technologies. In 1998 he started a parallel career writing technical articles for Italian and international magazines. He works in Rome for CPI Progetti Spa ( where he develops Internet/Intranet solutions using Microsoft technologies. Fabio would like to thank Wrox people who have given him the ch ance to write on this book, especially Alastair, for his kindness and consideration.

James Greenwood is a technical architect and author based in West Yorkshire, England. He spends his days (and most of his nights) designing and implementing .NET solutions from Government knowledge-management systems to mobile integration platforms, all the while waxing lyrical on the latest Microsoft technologies. His professional interests include research into distributed interfaces, the automation of application development, and human-machine convergence.

John Kauffman was born in Philadelphia, the son of a chemist and a nurse. John's family of six shared daily brain teasers and annual camping forays that covered most of the 50 United States. After jobs weeding strawberry patches, bussing tables, running spotlights for rock and roll concerts, touring North America with a drum and bugle corps, prematurely leaving three colleges, stuffing voles for a mammologist, packing boxes of rat poison, tarring roofs, delivering drapes in New York City, laboring in a candy factory, teaching canoeing, driving a forklift, studying tiger beetles in the Chihuahua desert, managing a picture framing factory, coaching a youth yacht racing team and volunteering as a human guinea pig for medical research, John (to the great relief of all around him) earned a pair of degrees in the sciences from The Pennsylvania State University and appeared to settle down. He then conducted research for Hershey Foods in the genetics of the cacao tree and the molecular biology of chocolate production. Subsequently he moved to the Rockefeller University where he identified, cloned and sequenced DNA regions which control the day and night biochemical cycles of plants.

Brian Matsik is the President and Senior Consultant at OOCS in Charlotte, NC and is currently a Microsoft Certified Solution Developer and Microsoft Certified Trainer. His experience with Visual Basic, VBScript, and VBA goes back to the DOS days and VB 2.0. Brian currently specializes in ASP, SQL Server, ADO, and VB COM. When he is not coding, training or writing he is either in his scuba gear or in the garage trying to turn perfectly good oak into perfectly good kindling.

Eric Mintz is a software analyst with over 20 years’ experience in a variety of technical and leadership positions.  His ceaseless enthusiasm and curiosity have contributed to wide-ranging expertise, particularly in the areas of computer/human-interaction, data and object modelling, SQL, and Visual Basic. Currently, Eric is CEO of American Webware, Inc. in Atlanta where he resides with his wife and her three cats who all think he works way too hard. When he does have spare time, Eric likes to play jazz guitar and trumpet or go fly-fishing. Eric holds a BSEE, earned at the University of Houston, TX.

Jan D. Narkiewicz is Chief Technical Officer at Software Pronto, Inc ( In his spare time Jan is Academic Coordinator for the Windows curriculum at U.C. Berkeley Extension, teaches at U.C. Santa Cruz Extension and writes for ASP Today.

Kent Tegels is a system developer and engineer working for HDR, Inc., a leading Engineering, Architecture and Consulting Firm. He is a Microsoft Certified Professional plus Site Builder, System Engineer (plus Internet) and Database Administrator.

John West is a Principal Consultant at Intellinet, based out of Atlanta, Georgia. He specializes in leading Microsoft .NET application development efforts. When not working, he usually spends his time reading, hanging out with friends from church, and trying to learn to wakeboard.

Donald Xie has 14 years experience in enterprise application development for various types of businesses. He is a co-author of "Professional CDO Programming" and a contributing author for a number of books. Donald currently works as a consulting system architect for the Department of Training in Western Australia, Australia. You can contact Donald at

Read More Show Less

Table of Contents


Chapter 1. Displaying Data on the Web.

Chapter 2. Relational Databases.

Chapter 3. Connecting to a Data Source.

Chapter 4. Data Readers, Command Objects, and Web Server Controls.

Chapter 5. Reading Data using the DataSet Object.

Chapter 6. Creating and Inserting Records.

Chapter 7. Using and Deleting Records.

Chapter 8. Updating Stored Procedures.

Chapter 9. Data-Driven ASP.NET Applications in the Real World.

Chapter 10. Componentization.

Chapter 11. Performance.

Chapter 12. Writing an Application.


Read More Show Less

First Chapter

Beginning ASP.NET Databases Using VB.NET

By John Kauffman Fabio Claudio Ferracchiati Brian Matsik Eric N. Mintz Jan D. Narkiewicz Kent Tegels Donald Xie John West Jesudas Chinnathampi James Greenwood

John Wiley & Sons

ISBN: 0-7645-4375-X

Chapter One

Displaying Data on the Web

When the Web first appeared, people had to find a metaphor for how information should be presented on it. If you took a sample of web sites from that period, the content largely was based around what you'd find in traditional media such as books, magazines, and newspapers. This led to the Web serving the same purpose as those other formats: it provided a snapshot of information as it stood at the time the pages were created. Of course, there was nothing wrong with that, but it placed restrictions on what the Web could reasonably be used for.

Over time, the technologies powering the Web have matured, and it has changed from only being able to provide static sites, to providing dynamic applications as well. These applications invite their users to make choices about the information they're interested in, providing a customized user experience that can be modified in real time.

The key to these applications is the data they contain. Regardless of what it is - it could be a product catalogue, or a set of customer details, or a document repository - it's the data that makes them dynamic. In the past, providing data over the Web has been a harder task than providing it through traditional desktop applications, due both to the development tools and functionality available, and the nature of the Web itself, where users are far removed from the applications and data. Over time, and in particular (from our point of view) with the introduction of Microsoft's .NET Framework, this situation has been improved. Web application developers are now on a more equal footing with their desktop-developing counterparts.

In this first chapter, we'll provide a broad introduction to the topic of data-driven web sites, and how they are implemented in ASP.NET. It starts with a discussion of the advantages and disadvantages of data-driven sites, and then moves on to examine the sources that such data can come from. After that, we'll look at the .NET Framework's data access strategy of choice - ADO.NET - including its architecture, its classes, and how it fits into the structure of data-driven applications. We'll finish by covering the installation of a database server that we'll use throughout this book.

Pros and Cons of Data-Driven Web Sites

Some of the advantages of having a data-driven system are immediately apparent, but there are others that are less tangible and not so readily evident. Naturally enough, there are also reasons why you might not want to attach a web site to a database. In this section, we'll examine the benefits and the drawbacks of creating a web site that's based around a data source.


There are many secondary benefits of making a web site data-driven, such as the ability to reuse portions of functionality in other projects, and being able to share common pieces of information across systems - these tend to kick in when you start to work on your second or your third web application. Here, we're going to look at some of the advantages that can start to accrue as soon as you make the decision to create a data-driven site:

Quality and timeliness of content. The most immediate advantages to making a site data-driven are the speed with which new information can be presented on the Web, and the controls that can be put in place to guarantee the quality of this information. Rather than having to get a web designer to create a page containing the information, and then get it uploaded again every time a price changes or a new product is added, a tool can be created that enables the instant publishing of new or updated information simply by modifying the database. This is one of the key benefits of the Web over traditional media - the ability to view information in real time, rather seeing than a snapshot of old data. By enforcing rules on who can add and amend data, how it is checked, and whether it is approved, data can be verified prior to being published in a much more rigorous manner, ensuring that the user only sees accurate details.

Functionality. The other main benefit of storing all of the data required for a site in a database is that of improved functionality in terms of the actions that the user can perform on the system. Rather than producing 'catalogues', which (like this book) just have an index and a contents table as a means of searching, forms can be created that allow the user to specify what is being looked for, and have the system scour the database for that information. A great example of this is a search engine. Without a database, such a site would present only a manual categorization of other web sites, with a huge structure of pages that you could (try to) navigate between.

Maintenance. With the data for a site stored in a separate location from the presentation code, there is no longer a need to maintain static links in HTML files between related sections of a site, forcing you to reapply formatting and menu structures to hundreds of pages each time the site is redesigned. In a data-driven system, web pages are typically templates that act for entire classes of pages, rather than having one page for each piece of information.

As an example of this, you could imagine the on-screen appearance of a page that displays the details of a product for sale. Rather than this being a separate HTML page, in a data-driven system there would be one page containing fields and tables that could be populated with data regarding any product. This means that there is far less to do each time a redesign is implemented. Similarly, as the relationship between different pieces of information can be stored in the database (rather than hard-coded in the pages), links to related products and other information can be generated on the fly.


Although there are many advantages to making a web site data-driven, some of them come at a price, and a data-driven site is not always the right solution to your problem. There are several hurdles that must be overcome in order to provide a richer experience to the end user, and it's important that you consider them before taking the plunge:

Development. A large number of web sites that are now data-driven started out being static, and there are still many static sites being created to this day. The nature of the content you want to present is not always suited to a data-driven site, and the creation of a data-driven system requires extra time and skills, resulting in a product that is more complex, and (inevitably) more prone to errors. These costs have to be weighed up against the advantages that such a system provides.

Performance. The performance of data-driven web sites is an issue that crops up regularly. If a site is entirely static, then there are no constraints on the way the system is organized, or on how it can expand to cater for higher volumes of users. The simplest way to increase performance is to buy a faster processor and more memory. When that stops being viable, multiple versions of the site can be created, and users redirected to whichever one is under least load. This can continue in a linear fashion, with the same increase in performance each time a new web server is added.

With a data-driven site, this is not the case, because the entire system is dependent upon one resource: the database. If it's not carefully designed, the database can create a bottleneck in the system, whereby the rest of the application is held up while it waits for information to be retrieved. Removing this bottleneck is a difficult problem to solve - having multiple synchronized databases is one of the few real solutions, but it can prove very expensive, and the overheads involved in this synchronization are significant.

Cost. In addition to the technical considerations mentioned above, there are also associated commercial issues. For a relatively static site, the time required to create a database and write the code to access it may be longer than it would take just to edit some HTML pages. Also, enterprise-class database systems are themselves expensive. Considering Microsoft's data storage solutions alone, it's well known that producing a solution using SQL Server (Microsoft's enterprise-level database server) provides many benefits over Access (its desktop database), such as higher performance and better support for industry standards, but comes with a price tag to match.

Data Sources

So: you've already considered some or all of the issues in the above lists, and you're still with us, which means that it's reasonable to assume you want to write a data-driven web application. The first question that needs to be answered, then, is where the information that will eventually end up on the user's screen is going to come from. Depending on factors such as the type of data, what operations are to be performed on the data, and the amount of use that is going to be made of the system, there are a multitude of options available. This section describes the reasons for and against using three of the most common data source types, along with an overview of the other types available.


When you start thinking about data sources, the most obvious one that springs to mind is the database, which will generally provide the most reliable, scaleable, and secure option for data storage. When you're dealing with large amounts of data, databases also offer the best performance. However, the very fact that other solutions exist is a sure indication that in some circumstances, they're not the best choice.

In general, databases are designed to store large amounts of data in a manner that allows arbitrary quantities of data to be retrieved in arbitrary order. For small collections of data, such as a set of contact details, the time and other costs involved in creating and accessing a database might outweigh the benefits that databases provide.

We'll have much more to say about the structure of databases in the next chapter, but as a quick example, wanting to store some information about a company employee in a database might move us to create a table called Employee that can contain the same pieces of data about a number of employees. Such information could include their EmployeeID (number), LastName, FirstName, BirthDate, and Country:

Employee EmployeeID LastName FirstName BirthDate Country

Throughout this chapter, comparisons and demonstrations will be made of how data can be stored and represented. For consistency, the same example is used throughout: that of storing details about the employees in an organization.

One thing to note when we display a database diagram, compared to the diagrams of other data sources, is that it's based on a model of the information being stored, rather than examples of the data. The way in which databases actually hold information is largely hidden from the outside world, leaving us to depict concepts rather than actual data items.

Text Files

At the opposite end of the scale from using databases to store information for a web site is the use of text files. Although text files can store information in almost any conceivable format, they are generally used for storing a set of data, one item on each line. If we were to capture the employee information detailed above, we could store the LastName, FirstName, BirthDate, and Country of two employees in a text file as follows:

Smith, John, 05-04-1979, UK Bloggs, Joe, 29-09-1981, US

For simple information such as this, a text file provides an easy way of reading and writing data. If the data to be stored has more structure, however, it becomes far more time consuming. For example, it could be the case that each of these employees has placed an order for some office supplies. Rather than adding all of that information to the text file as well, it would be better to hold it separately, and then define relationships between the two sets of data.

When the data starts to gain 'structure' in this manner, a method of giving the file itself some structure must be found, and a way of retrieving it and representing it in memory must also implemented. One way of doing this is through the use of XML.


In some ways, XML documents can be thought of as a stepping-stone between text files and databases; they store data using text files, but use a hierarchical and relational format that is both extensible and self-describing, providing a number of the benefits of a database system. Before we go any further in explaining the use of XML as a data source, a sample fragment of an XML document is shown below:

As you can see, the same information is being stored as in the text file, but there's also an indication of the nature of that information. You know that 29-09-1981 is the BirthDate of Joe Bloggs, because the data says so. Another benefit of XML is that it can contain multiple types of information in one document; a fragment like the one below could be inserted after :

Staples Pencils Biros Erasers

Using the comprehensive functionality that's built into the XML-handling support provided by the .NET Framework (and other platforms), retrieving and manipulating the orders separately from the employees can be accomplished quite easily. This makes it possible to specify an order from the list for each employee by storing the ID of each order as part of the employee's details:

XML is a powerful way of representing information, but in some circumstances performance can be a problem: updating and retrieving data from XML can be a time-consuming process. This is rarely an issue when a few users are accessing a small amount of data, but if there's a lot of data (or a lot of users) it can sometimes become one.


Excerpted from Beginning ASP.NET Databases Using VB.NET by John Kauffman Fabio Claudio Ferracchiati Brian Matsik Eric N. Mintz Jan D. Narkiewicz Kent Tegels Donald Xie John West Jesudas Chinnathampi James Greenwood Excerpted by permission.
All rights reserved. No part of this excerpt may be reproduced or reprinted without permission in writing from the publisher.
Excerpts are provided by Dial-A-Book Inc. solely for the personal use of visitors to this web site.

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)