title: Try block being called twice
body: <p>So I have a function that retrieves data from a database, and outputs it. It's encased in a try block, so that the error from running out of rows to process is dealt with.</p>
  
  <p>Here's the function that is called on load (to make the <em>initial output</em>), and called later on to update the log box. </p>
  
  <p>Problem is, whenever I call the function again, it outputs the data twice. Since only the data is in the try block, and not the headers, this points to the try / catch being the issue.</p>
  
  <p>Apologies for the messy / hacky code:</p>
  
  <pre><code>    private void NavigateRecords()
      {
          da.Fill(ds1, "LogOutput");
          textlog4.Text = "Date \t\t Time \t\t Floor\r\n";
          try
          {
              for (int i = 0; i &lt;= 20; i++)
              {
                  DataRow dRow = ds1.Tables["LogOutput"].Rows[i];
                  for (int i2 = 1; i2 &lt;= 3; i2++)
                  {
                      textlog4.Text += dRow.ItemArray.GetValue(i2).ToString() + "\t\t";
                  }
                  textlog4.Text += "\r\n";
  
              }
          }
          catch { textlog4.Text += "----------------------"; }  
      }
  </code></pre>
  
  <p>This is the code that does part of the connecting, and may be of use:</p>
  
  <pre><code>        string sql = "SELECT * From tblLog";
          da = new System.Data.SqlClient.SqlDataAdapter(sql, con);
          NavigateRecords();
  </code></pre>
  
  <p>Initial output:</p>
  
  <pre><code>Date         Time        Floor
  6/12        18:18:22        1       
  ----------------------
  </code></pre>
  
  <p>Output next time it is called:</p>
  
  <pre><code>Date         Time        Floor
  6/12        18:18:22        1       
  6/12        18:46:19        2       
  6/12        18:18:22        1       
  6/12        18:46:19        2       
  ----------------------
  </code></pre>