Flylib.com

Books Software

 
 
 

Downloading the Example Programs

Downloading the Example Programs

Throughout this book, you'll see many example programs that illustrate the concepts described in the text. These are marked with a listing number and title, such as the one shown here:

LISTING 1.1 : FIRSTEXAMPLE.CS

The filenames will correspond to the listing name : FirstExample.cs is the filename for Listing 1.1. You can download a Zip file containing the programs from the Sybex Web site at www.sybex.com . You can use a program such as WinZip to extract the contents of the Zip file.

When you unzip this file, one directory for each chapter will be created. Each directory will contain the following sub-directories as required:

  • programs Contains the C# programs.

  • sql Contains SQL scripts.

  • VS. NET projects Contains the Visual Studio .NET projects.

  • xml Contains the XML files.

Note 

Not all chapters reference programs, sql scripts, etc., and therefore may not contain all the previous sub-directories.


Part 1: Introduction to ADO.NET and Databases

Chapter List

Chapter 1: Introduction to Database Programming with ADO.NET
Chapter 2: Introduction to Databases
Chapter 3: Introduction to Structured Query Language (SQL)
Chapter 4: Introduction to Transact-SQL Programming
Chapter 5: Overview of the ADO.NET Classes
Chapter 6: Introducing Windows Applications and ADO.NET


Chapter 1: Introduction to Database Programming with ADO.NET

Overview

A Database is an organized collection of information that is divided into tables . Each table is further divided into rows and columns ; these columns store the actual information. You access a database using Structured Query Language (SQL), which is a standard language supported by most database software including SQL Server, Access, and Oracle.

In this chapter, you'll see a C# program that connects to a SQL Server database, retrieves and displays the contents stored in the columns of a row from a table, and then disconnects from the database. You'll also see programs that connect to Access and Oracle databases.

You'll also learn about Microsoft's rapid application development (RAD) tool, Visual Studio .NET (VS .NET). VS .NET enables you to develop, run, and debug programs in an integrated development environment. This environment uses all the great features of Windows, such as the mouse and intuitive menus , and increases your productivity as a programmer.

In the final sections of this chapter, you'll see how to use the extensive Microsoft documentation that comes with the .NET Software Development Kit (SDK) and VS .NET. You'll find this documentation invaluable as you become an expert with ADO.NET and C#. You'll also learn how to use the SQL Server documentation.

Featured in this chapter:

  • Obtaining the required software

  • Developing your first ADO.NET program

  • Connecting to Access and Oracle databases

  • Introducing Visual Studio .NET

  • Using the .NET documentation

  • Using the SQL Server documentation


Obtaining the Required Software

Before you can develop C# programs, you'll need to install either the .NET Software Development Kit (SDK) or VS .NET. You can download the .NET SDK at http://msdn.microsoft.com/downloads (search for the Microsoft .NET Framework Software Development Kit). You can purchase a trial or full copy of VS .NET from Microsoft at http://msdn.microsoft.com/vstudio .

To install the .NET SDK, run the executable file you downloaded and follow the instructions on the screen to install it on your computer. To install VS .NET, run the setup.exe file on the disk and follow the instructions on the screen.

You'll also need a copy of the SQL Server database software. At time of writing, you can download a trial version of SQL Server from Microsoft at http://www.microsoft.com/sql . You can also purchase a trial or full copy of SQL Server from Microsoft's Web site.

This book uses the Developer Edition of the SQL Server 2000 software and uses a database named Northwind. This database contains the information for the fictitious Northwind Company, which sells food products to customers. Northwind is one of the example databases that you can install with SQL Server. Customer information in the Northwind database is stored in a table named Customers ; you'll see the use of this table in the example program later in this chapter.

If you don't want to download or purchase a trial version of SQL Server, the .NET SDK (and VS .NET) comes with a stand-alone desktop database server known as the Microsoft SQL Server 2000 Desktop Engine (MSDE 2000). MSDE 2000 has a version of the Northwind database that you can use instead of the SQL Server Northwind database-although you won't get all of the graphical administration tools that come with SQL Server. If you're using the .NET SDK and want to install MSDE 2000, select Start Microsoft .NET Framework SDK Samples and QuickStart Tutorials. If you're using VS .NET and want to install MSDE 2000, run the setup.exe program that you use to install VS .NET and select MSDE 2000 as a new feature to install.

Note 

You can learn more about MSDE 2000 at http://www.microsoft.com/sql/techinfo/development/2000/msde2000.asp .