Chapter 3: Connecting to a Data Source

Chapter 3 - Connecting to a Data Source
byJohn Kauffman, Fabio Claudio Ferracchiatiet al.?
Wrox Press ?2002

Overview

As we discussed in Chapter 1, all of the interactions between ASP.NET and data that you'll see in this book will start with an ADO.NET connection. The connection establishes what data source the page will use, the security details necessary to authorize access to the data, and the data provider that will handle the translations between the data source and the ADO.NET objects. However, the syntax you use to create the connection, and the options available to you, vary considerably with different sources of data.

You know that in ASP.NET, getting data from a database to the web page that your users will see in their browsers requires a number of ADO.NET objects: connections, datasets, data readers, data adapters, and so on. In order to provide useful demonstrations, we'll be using quite a few of these different objects in this chapter, but our focus is on the first item in that list - the others will have their time in the sun a little later on. Our aim here is to understand ADO.NET connection objects, and in order to do so we'll look at the following topics:

  • The basics of ADO.NET connections

  • Connecting to Microsoft SQL Server data

  • Connecting to an MS Access database

  • Connecting to an MS Excel spreadsheet

  • Connecting to an XML data file

  • Getting schema information about a data store

  • Some common mistakes



Beginning ASP. NET 2.0 and Databases
Beginning ASP.NET 2.0 and Databases (Wrox Beginning Guides)
ISBN: 0471781347
EAN: 2147483647
Year: 2004
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net