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 As SqlClient.SqlCommandBuilder Private mstrConn As String Private mintBoundTable As Integer = 0 Private mblnAutoText As Boolean Public Event BoundTableChanged(ByVal intBoundTable As Integer) Public Event DataSetFilled(ByVal dsDataSet As DataSet) Public Event PositionChanged(ByVal intNewRow As Integer) #Region " Windows Form Designer generated code " Don't worry about what these are for yet, especially the SqlCommandBuilder object. We will discover what they do shortly. |