title: C# SQLite crashing if input is wrong
body: <p>I've got an problem with an Windows Forms Program: The user should be able to choose which table(year) they want to see.</p>
  <p>That's my solution:</p>
  <pre><code>SQLiteConnection con = new SQLiteConnection(@&quot;Data Source=C:\App\DRSTZMSTR\Datenbank\Database.db&quot;);
  con.Open();
  string query = &quot;SELECT* from '&quot;+yeartxtbox.Text+&quot;' &quot;;
  SQLiteCommand cmd = new SQLiteCommand(query, con);
  DataTable dt = new DataTable();
  SQLiteDataAdapter adapter = new SQLiteDataAdapter(cmd);
  adapter.Fill(dt);
  
  dataGridView1.DataSource = dt;
  con.Close();
  </code></pre>
  <p>I'm using a textbox &quot;yeartxtbox&quot; to receive the wanted table.
  Basically its working, but every time the user inputted table does not exist the program crashes.</p>
  <p>Any idea how I could fix this?</p>
  <p>My thoughts:</p>
  <p>Instead of using a textbox I could use an combobox to display the existing tables, but I have no ide how to realize this. I couldn't find anything online.</p>