Hour 3. Using T-SQL: A Crash Course

for RuBoard

ADO.NET enables you to connect to a data source and retrieve and manipulate data. However, ADO.NET doesn't actually gather the data itself. It simply sends a string to the data source with data processing instructions. The language used to communicate with the data source is known as T-SQL (Transact-SQL), which is a dialect of Structured Query Language (SQL).

Because you must provide ADO.NET with the proper T-SQL statements for data retrieval and manipulation, knowledge of T-SQL is an essential skill for any well-rounded developer. Hundreds of different kinds of T-SQL statements are available in a product such as Microsoft SQL Server. You can modify many aspects of the server itself, such as managing jobs, creating and maintaining databases, and other administrative tasks . This chapter provides a primer; you'll learn just enough about T-SQL to understand all the examples in this book.

In this chapter, you will learn how to do the following tasks:

  • Retrieving data with the SELECT statement

  • Adding data with the INSERT statement

  • Modifying data with the UPDATE and DELETE statements

  • Using some T-SQL built-in functions

Microsoft SQL Server and Microsoft Access both ship with a sample database called Northwind. This database will be used for the examples in this chapter. The Northwind access database is freely distributed. You can download it at http://www.intensitysoftware.com/ADO.NET/nwind.mdb. If you are using a default installation of Microsoft SQL Server, you'll see an entry in your program group for the Query Analyzer. You can launch this application, select Northwind as your database, and follow along with the examples in this chapter directly.

If you are using another data source, such as Oracle, you still should be able to follow along. Your database server probably ships with an application like Query Analyzer that you can use to enter database queries. Use that to enter the queries in the following sections.

for RuBoard

Sams Teach Yourself ADO. NET in 24 Hours
Sams Teach Yourself ADO.NET in 24 Hours
ISBN: 0672323834
EAN: 2147483647
Year: 2002
Pages: 237

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