O'Reilly logo

Sams Teach Yourself ADO.NET in 24 Hours by Paul Bertucci, Jason Lefebvre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving Data with SELECT

The SELECT statement is used to retrieve and filter data from your data source. Listing 3.1 shows the simplified syntax of the SELECT statement. Read from top to bottom, this statement says “select these columns from these tables where these search criteria are true.” You can retrieve several column names from several tables, so long as you separate the column names by commas.

Listing 3.1. The Syntax of the SELECT SQL Statement
SELECT
     column_names
FROM
     table_names
WHERE
     search_conditions

For instance, to retrieve all records from the Employees table, enter the following code in the query manager and press F5 or click the green Play button to execute the query:

SELECT * FROM Employees

This will return every single ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required