title: Issue with bindingsource refresh after row insert - Object reference not set to an instance of an object
body: <p>Windows Form Application,
  VS 2010 C#,
  Access 2003</p>
  
  <p>I am referencing from this website, <a href="http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/d53ad3fa-effc-4c9a-8520-897ecd85aa5f/" rel="nofollow">here</a>. My aim is to show updated records (insert/delete update) without closing and restarting the application to show new reflection. I have quite a few textboxes, comboxes etc, so I am not using datagridview. </p>
  
  <p>From that website there are two pieces of code...</p>
  
  <pre><code>bindingNavigator1.BindingSource = bdSource;
  this.dataGridView1.DataSource = bdSource;
  </code></pre>
  
  <p>So I did this...</p>
  
  <pre><code>this.table1BindingSource = dbSource;
  </code></pre>
  
  <p>and gave a error of "<strong>Object reference not set to an instance of an object</strong>."  With a warning that <strong>dbSource is never assigned and will aways have a default value null</strong>.</p>
  
  <p>my insert command parameter structure..</p>
  
  <pre><code>OleDbCommand cmd = new OleDbCommand(@"INSERT INTO Table1 (ID, Name) VALUES(@ID, @Name)", myCon);
  cmd.CommandType = CommandType.Text;
  cmd.Parameters.AddWithValue("@ID", txtID.Text);
  cmd.Parameters.AddWithValue("@Name", txtName.Text);
  myCon.Open();
  cmd.ExecuteNonQuery();
  myCon.Close(); 
  </code></pre>
  
  <p>The following method I am hoping data would be refreshed...</p>
  
  <pre><code>private void btnReload_Click(object sender, EventArgs e)
  {
    OleDbDataAdapter.Update(dtSource);
  }
  </code></pre>
  
  <p>and...</p>
  
  <pre><code>public partial class Form1 : Form
  {
      private OleDbConnection myCon;
      private string connectionString;
      private string commandText;
      private OleDbCommandBuilder OleDbCommandBuilder;
      private OleDbDataAdapter OleDbDataAdapter;
      private DataTable dtSource;
      private BindingSource dbSource;
  
   public Form1()
      {
       connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data.. ";
       commandText = "SELECT * FROM TABLE1";
  
      myCon = new OleDbConnection(connectionString);
      OleDbDataAdapter = new OleDbDataAdapter(commandText, myCon);
      OleDbCommandBuilder = new OleDbCommandBuilder(OleDbDataAdapter);
  
     dtSource = new DataTable();
     OleDbDataAdapter.Fill(dtSource);
  
          dbSource = new BindingSource();
          dbSource.DataSource = dtSource;
  </code></pre>
  
  <p>Thanks in advance for anyone who could help me  </p>
  
  <p><strong>EDIT</strong>
  I also have navigation buttons..</p>
  
  <pre><code>  private void fnDisplayPosition()
      {
          this.label2.Text = this.table1BindingSource.Position + 1 + " of " + 
          this.table1BindingSource.Count;
          table1BindingSource.ResetBindings(false);
      }
  </code></pre>
  
  <p>then in the Form load...</p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
      {
          this.fnDisplayPosition();
      }
  </code></pre>
  
  <p>Example of navigation button... </p>
  
  <pre><code>  private void btnFirst_Click(object sender, EventArgs e)
      {
          this.table1BindingSource.MoveFirst();
          this.fnDisplayPosition();
      }
  </code></pre>
  
  <p><strong>UPDATE 2</strong>
  I did some error in coding so warning signs and errors are gone</p>