title: How to properly store data into database
body: <p>I'm facing a very simple problem, but I don't know how to solve it. I have a simple textBox, and local database, <code>Database1.mdf</code>, with one table: emp. Inserting data works fine, but when I restart application, then these data are lost.</p>
  
  <p>I'm also using a dataSet, where I can see data in the table - the record is properly inserted, but it is lost when I restart the app. What am I missing?</p>
  
  <p>I'm running a C# application (VS2013):</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      SqlConnection cn = new SqlConnection(global::base.Properties.Settings.Default.Database1ConnectionString);
      try {
          string sql = "INSERT INTO emp (name) VALUES ('" + textBox1.Text + "')";
          SqlCommand exesql = new SqlCommand(sql, cn);
          cn.Open();
          exesql.ExecuteNonQuery();
          MessageBox.Show("Hooray!!");
          this.empTableAdapter.Fill(this.database1DataSet.emp);
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
      finally
      {
          cn.Close();
      }
  }
  </code></pre>