Microsoft Visual Basic 2010 Step by Step eBook

(Tina Meador) #1

488 Part IV Database and Web Programming


table updates from the data grid view back to the original database. As you can begin to
see, database programming with ADO .NET and Visual Studio is straightforward but also
somewhat involved. There are many tools, components, and programming techniques
related to viewing, manipulating, and updating database records, and we haven’t even
begun to talk seriously about important issues such as security and what happens when you
work with large databases that are being used by many users at the same time.

Although you’ve been able to accomplish a lot with little or no program code, there is still
much to learn if you plan to make extensive use of databases within Visual Basic applications.
For a list of books I recommend for you to continue your studies, see the Appendix, “Where
to Go for More Information .”

Data Access in a Web Forms Environment
The data access techniques discussed in Chapter 18 and this chapter were designed
for use in the Windows Forms Designer—the Visual Studio environment that you’ve
used to build most of the programs in this book. However, you can also use ADO .NET
programming techniques in a Web Forms environment, which allows you to share data
resources over the Internet and datacentric applications that are accessible through
a Web browser such as Internet Explorer. I’ll show you how to do this near the end
of the next chapter, and you’ll learn how to use a few new tools there too, including
the GridView control, a version of the DataGridView control designed for displaying
database tables on Web sites.

Chapter 19 Quick Reference


To Do This
Establish a connection to
database tables in a project

Use the Data Source Configuration Wizard to link the project to
a database, create a dataset, and fill the Data Sources window with
a representation of the selected tables.
Create a data grid view
object on a form to display
an entire database table

Drag a table icon from the Data Sources window to the form.
Then resize the data grid view object so that each column is visible.

Preview data bound to
a data grid view object

Click the data grid view object’s smart tag to display the DataGridView
Tasks list. Click the Preview Data command, and then click the Preview
button in the Preview Data dialog box.
Remove a column from
a data grid view object

Click the data grid view object’s smart tag to display the DataGridView
Tasks list. Click the Edit Columns command, click the column that
you want to remove in the Selected Columns box, and then click the
Remove button.
Free download pdf