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

Initialization Code

Before we continue, let’s finish the initialization code. Go back to the constructor. After the code we added to wire the events, let’s add this code:

mSQLBuilder = New SqlClient.SqlCommandBuilder(mAdapter) 
mAdapter.SelectCommand = New SqlClient.SqlCommand("", mConnection) 
mAdapter.InsertCommand = New SqlClient.SqlCommand("", mConnection) 
mAdapter.DeleteCommand = New SqlClient.SqlCommand("", mConnection) 
mAdapter.UpdateCommand = New SqlClient.SqlCommand("", mConnection) 

mDataSet.Tables.Add() 

These initializers just precreate the objects mentioned so they show up in the Property window correctly. Before the region add the following declarations. The region statement is shown for a point of reference:

 Private mSQLBuilder ...

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