title: Insert data in access file using dataset
body: <p>I want to insert data into a access file.
  I dont want to insert it directly with insert into but using a dataset</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      if (textBox1.Text != "")
      {
          string q = "insert into info (name) values ('"+textBox1.Text.ToString()+"')";
          aanpassen(q);
          textBox1.Text = null;               
      }
  }
  </code></pre>
  
  <p>Here is the other part</p>
  
  <pre><code> private void aanpassen(String q)
      {
          try
          {
  
              cn.Open();
              cmd.CommandText = q;
              cmd.ExecuteNonQuery();
              cn.Close();
              loaddata();
  
              //connection
          }
  
          catch (Exception e)
          {
  
              MessageBox.Show(e.Message.ToString());
          }
         finally
         {
         cn.Close();
         }
      }
  </code></pre>