title: SQL Check if table Exists in C#, if not create
body: <p>I think I've seen almost every page relating to this question, most likely answer was
  <a href="https://stackoverflow.com/questions/464474/check-if-a-sql-table-exists/464506#464506">Check if a SQL table exists</a>
  but didn't really understand it. This is what I got:</p>
  
  <pre><code>    private void select_btn_Click(object sender, EventArgs e)
      {
          string theDate = dateTimePicker1.Value.ToString("dd-MM-yyyy");
          SqlConnection SC = new SqlConnection("Data Source=ruudpc;Initial Catalog=leden;Integrated Security=True");
          SqlCommand DateCheck = new SqlCommand("SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = '" + theDate + "'");
      }
  </code></pre>
  
  <p>Now I want a return value from DateCheck.ExecuteScalar(); that can tell me if it exists or not, probably dead simple.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Regardless for the sql injection part, and that for some this question is helpful, it is generally bad practice to create tables on the fly, I recommend you reconsider your ERD. Just saying.</p>