O'Reilly logo

Microsoft® .NET Compact Framework (Core Reference) by Mark Sutton, Rory MacLoed, Robert Burbidge, Stephen Wheelwright, Andy Wigley

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

A detailed look at accessing data in a SQL Server database, with a sample application, follows. The sample application, GettingSQLDataSample, is available with this book’s sample files. The application’s code retrieves some data that is to be read-only in the application and that can be collected all in one go. The sample application includes the Transact-SQL that’s required for selecting the data, but before you try the sample, you’ll need to set up the DotNetCF database that this sample accesses. (See the Readme file included with this chapter’s sample files.)

GettingSQLDataSample uses the following System.Data.SqlClient objects (in the order that you’ll meet them):

  • SqlConnection

  • SqlCommand

  • SqlDataReader

  • SqlException and SqlError ...

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