title: Check if a database table contains any rows
body: <p>I'm loading data into a form with 3 <code>Entry</code> controls. </p>
  
  <p>The object I am using for this is called <code>mySettings</code>, which is an object of <code>SystemSettings</code>, a class and database table in my <code>SQLite</code> database.</p>
  
  <p>So far I have this code, and it works as is.</p>
  
  <pre><code>var db = new SQLiteConnection(dbPath);
  
  Entry txtServer;
  txtServer = new Entry { FontSize = 10 };
  controlGrid.Children.Add(txtServer, 2, 0);
  Grid.SetColumnSpan(txtServer, 4);
  
  SystemSettings mySettings;
  mySettings = db.Get&lt;SystemSettings&gt;(0);
  txtServer.Text = mySettings.FTPServer;
  </code></pre>
  
  <p>However, I need to check whether <code>SystemSettings</code> contains any rows in the table before I load values in.</p>
  
  <p>I've seen a few guides online.</p>
  
  <p>Some say use something along the lines of</p>
  
  <pre><code>SQLiteCommand cmd;
  cmd = new SQLiteCommand(db);
  
  ...
  
  int result = Convert.ToInt32(db.ExecuteScalar)
  </code></pre>
  
  <p>However, I get an error there saying</p>
  
  <blockquote>
    <p>SQLiteCommand does not contain any method containing x parameters</p>
  </blockquote>
  
  <p>no matter how many I pass in (0 or more).</p>
  
  <p>There also doesn't appear to be a method as part of <code>db.</code></p>
  
  <p>So how can I check whether <code>SystemSettings</code> contains any rows, before trying to use data that doesn't exist?</p>