title: C# : Not Able to update data on database using DataGridView and SqlCeConnection
body: <p>I tried everything . Not able to fix and find the work around.</p>
  
  <p>Error: A parameter is missing. [ Parameter ordinal = 2 ] on command a.update(t);</p>
  
  <p>Technology : C#,Visual Studio 2008</p>
  
  <pre><code>    public partial class Doctor : Form
      {
      SqlCeConnection con = new SqlCeConnection("Data Source=C:\\Users\\user\\Documents\\Visual Studio 2008\\Projects\\DBConnectionCSharp\\DBConnectionCSharp\\DBTesting1.sdf");
      SqlCeCommand cmd;
      DataTable t = new DataTable();
      SqlCeDataAdapter a;
      DataSet ds;
      SqlCeCommandBuilder cam;
  
  
      public Doctor()
      {
          InitializeComponent();
          this.Visible = true;
          con.Open();
          cmd = con.CreateCommand();
          cam = new SqlCeCommandBuilder(a);
          cmd.CommandText = "update Doctor set Name=@p2 where ID=@p1";
  
      }
  
      private void Doctor_Load(object sender, EventArgs e)
      {
         using (a = new SqlCeDataAdapter("SELECT * FROM Doctor", con))
          {
              a.Fill(t);
              DoctorView.DataSource = t;
  
          }
          con.Close();
      }
  
      private void Save_Click(object sender, EventArgs e)
      {
          a.UpdateCommand = cmd;
          a.Update(t);
      }
  }
  </code></pre>