ASP.NET
  Home arrow ASP.NET arrow Interacting with Databases
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Interacting with Databases
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 14
    2006-04-06

    Table of Contents:
  • Interacting with Databases
  • Namespaces and Classes
  • Creating a Database and Tables
  • Were Any Rows Returned?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Interacting with Databases


    (Page 1 of 4 )

    This article, the first of three parts, explains how to link your ASP.NET web pages with your own database by using the ADO.NET connection, as well as how to write SQL statements in a query that direct the DBMS to perform common tasks. It is excerpted from chapter 10 of ASP.NET 2.0 DeMYSTiFieD, written by Jim Keogh (McGraw-Hill/Osborne; ISBN: 0072261412).

    Whenever you log into your favorite e-commerce web site, you set off a series of routines behind the scenes that, among other things, links the web site with a database that contains product information and probably information about you.

    You too can link your ASP.NET web pages with your own database by using the ADO.NET connection. Think of ADO.NET as your pipeline into popular commercial database management software (DBMS) such as Microsoft SQL Server, the Oracle database server, and Microsoft Access.

    In this chapter you’ll learn how to make this connection and how to write SQL statements in a query that direct the DBMS to perform tasks that are commonly used in many commercial web sites.

    The ADO.NET Connection

    Customer data and other information that is typically used by an ASP.NET web page are stored in a database that is managed by database management software (DBMS). As you remember from the preceding chapter, a DBMS such as Microsoft SQL Server, the Oracle database server, or Microsoft Access is a filing cabinet and file clerk all rolled up into one and maintains and accesses data as requested.

    Your application interacts with a DBMS by sending it queries using the Structured Query Language (SQL). For example, if you wanted to retrieve a customer’s account information, you’d write an SQL query and send it to the DBMS. The DBMS locates and returns the account information to your application.

    However, before you can send the query, you need to connect your application to the DBMS. You do this by using classes provided by ADO.NET. ADO.NET is part of the .NET framework. Although this sounds imposing, it really isn’t.

    As you’ll recall from Chapter 2, an object is a real thing that is described by a class definition. In the case of ADO.NET, these objects are database-related “things” such as rows, columns, tables, and databases. ADO.NET contains class definitions that are used to access a database. Remember that a class contains functions and attributes. A function is a block of code that is executed by calling the name of the function. An attribute is data associated with the class.

    Therefore, ADO.NET contains code that you call within your application to connect your application to a DBMS and enables your application to send queries to and receive data from a DBMS.

    More ASP.NET Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "ASP.NET 2.0 DeMYSTiFieD," published by...
     

    Buy this book now. This article is excerpted from chapter 10 of ASP.NET 2.0 DeMYSTiFieD, written by Jim Keogh (McGraw-Hill/Osborne; ISBN: 0072261412). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT