Chapter 27. Using .NET Data Providers

IN BRIEF

This chapter will show you how to use the various data providers that ship with the .NET Framework, as well as mention some alternative data providers that are available. A data provider is a collection of classes that provides programmatic access to some source of data. That data source could be a flat file on a disk, an MS Access database, an Excel spreadsheet, an Oracle server, SQL Server, or virtually any other data source on the market.

You will see how the SQL and OLEDB data providers work, as well as how to attach a DataSet to a data provider for automatic propagation of changes to the DataSet to the data source. By the end of this chapter, you will have a firm grasp on the concept of a data provider, how to use data providers, and how to use a data provider in combination with a DataSet for dynamic binding and updating.

WHAT YOU NEED

REQUIRED SOFTWARE.NET Framework SDK v1.1

Visual Studio .NET 2003 with C# installed

SQL 2000 Sample DB and/or MS Access sample DB
RECOMMENDED HARDWARE SKILLS REQUIREDPC that meets .NET SDK minimum requirements C# and .NET familiarity

USING .NET DATA PROVIDERS AT A GLANCE

SQL Server Data Provider537  
 Introduction to the SQL Server Data Provider537The SqlCommand Class540
 Using the SqlConnection Class537The SqlDataReader Class542
 Using Database Connection Strings with a SqlConnection539The SqlDataAdapter Class542
Working with the OLEDB Data Provider544  
 Overview of the OLEDB Data Provider545Using the OleDbDataReader546
 Using the OleDbConnection545Using the OleDbDataAdapter546
 Using the OleDbCommand545  
Additional Data Providers547  
 The Oracle .NET Data Provider (ODP.NET)547The .NET ODBC Data Provider548
  The mySQL .NET Data Provider548
 The Microsoft .NET Data Provider for Oracle547  
DataSet and DataAdapter Binding548  
 DataSet Review Review548Sample: Hooking Up a DataSet to a Live Data Source549
 Associating a DataSet with a DataAdapter549  
Summary552  
Further Reading552  

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

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