title: Counting using the TableAdapter
body: <p>I'm doing a schoolproject involving C# and some basic DataBase operations. One of the operations I need is a record count, after a long time of searching I can't figure out what I'm doing wrong. </p>
  
  <p>I've tried TabelAdapter.Rows.Count but for some reason that doesn't work.</p>
  
  <p>Included is a part of my code:</p>
  
  <pre><code>private void AddButton_Click(object sender, EventArgs e)
  {
      int RecordCount = 0;
      try
      {
          vriendenkringDataSetTableAdapters.FriendsTableTableAdapter FTTA = new vriendenkringDataSetTableAdapters.FriendsTableTableAdapter();
          RecordCount = FTTA.Rows.Count();
          FTTA.Insert(RecordCount, NicknameTextBox.Text, BirthdayTimePicker.Value, EmailTextbox.Text, 100, Convert.ToBoolean(1));
          //MessageBox.Show(Convert.ToString(RecordCount));
          MessageBox.Show("Friend added succefully");
      }
      catch
      {
          MessageBox.Show("Something went wrong");
          MessageBox.Show(Convert.ToString(RecordCount));
      }
  }
  </code></pre>
  
  <p>I hope you guys can help me!</p>
  
  <p>Regards,
  Rick</p>