Murach's ADO.NET 3.5, LINQ,
and the Entity Framework with VB 2008

How to work with connections, commands,
and data readers

This chapter shows you how to use connections, commands, and data readers for building 3-layer applications, the way the professionals do. At the end of this chapter, you'll be building simple 3-layer applications of your own.

Chapter 6 How to work with connections, commands, and data readers
How to create and work with connections and commands 200
How to create and work with connections 200
How to create a connection string using the SqlConnectionStringBuilder class 202
How to create a connection in a Using block 202
How to create and work with commands 204
How to work with queries that return a result set 206
How to create and work with a data reader 206
How to improve the efficiency of column lookups 208
An Invoices by Due Date application that uses a data reader 210
The user interface 210
The class design 210
The code for the Invoice class 212
The code for the InvoiceDB class 214
The code for the PayablesDB class 214
The code for the Invoices by Due Date form 216
How to work with queries that don’t return a result set 218
How to execute a query that returns a scalar value 218
How to execute an action query 218

Murach's ADO.NET 3.5 with VB 2008

Learn more about this book

View the table of contents


More about the eBook



Our 100% Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a prompt refund...no questions asked.