title: whats the use of data adapter
body: <p>Can anyone explain why an <code>SqlDataAdapter</code> is used in the following code? The code is working fine without this adapter. </p>
  
  <p>Also, why do we use <code>DataAdapter</code>? Please help me to understand this <code>DataAdapter</code> usage.</p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
  
          private void button1_Click(object sender, EventArgs e)
          {
              try
              {
                  SqlConnection con = new SqlConnection("Data Source=.....\\SQLEXPRESS;Initial Catalog=......;Integrated Security=True");
                  con.Open();
  
                  SqlDataAdapter da =new SqlDataAdapter(); // Why use `SqlDataAdapter` here?
                  SqlCommand sc = new SqlCommand("insert into bhargavc values(" + textBox1.Text + "," + textBox2.Text + ");", con);
                  var o = sc.ExecuteNonQuery();
                  MessageBox.Show(o + "record to be inserted");
                  con.Close();
              }
              catch (Exception)
              {
                  MessageBox.Show("error in the code");
              }
          }      
  
          private void button2_Click(object sender, EventArgs e)
          {
              Application.Exit();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
          }
      }
  }
  </code></pre>