O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

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

Creating the Components

The first thing to do is add the data components to form. Add an SqlConnection, an SqlDataAdapter, and a DataSet. Cancel out of the wizard for the SqlDataAdapter. When the DataSet configuration wizard appears, select untyped DataSet and click OK. Name the SqlConnection mConnection, the SqlDataAdapter mAdapter, and the DataSet mDataset. Close the Designer window and open the Code window.

Data Navigation

Now it’s time to start writing code. The first bit of functionality to add is the ability to connect to a database. We will use our Connection object for this. First create a property to expose the Connection object to the world. This will have an interesting effect we will look at later on:

 Public Property Connection() ...

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