title: Update data from database on click of button
body: <p>I have a kendo dropdown and on selected id value i want to update data of particular row from database on button click event.but my dat is not updating and the old values are shown again and again.Please suggest me how to do it.
  My code is</p>
  
  <pre><code>&lt;script src="Js/jquery1.7.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="CSS/kendo.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type="text/javascript"&gt;
    $(document).ready(function(){
      $("#multi").kendoDropDownList();
      $("#editor").kendoEditor();
   });
  &lt;/script&gt;
  &lt;form id="form1" runat="server"&gt;
  &lt;div&gt;
     Select Template: &lt;select id="multi" runat="server"&gt;&lt;/select&gt;
  &lt;/div&gt;
  &lt;br /&gt;
  &lt;div&gt;
    Template Name: &lt;input type="text" id="txtName" name="Name" runat="server" /&gt;
  &lt;/div&gt;
  &lt;div&gt;
  Description:&lt;textarea name="comments" id="txtComment" cols="25" rows="5"   
  runat="server"&gt;&lt;/textarea&gt;
  &lt;br /&gt;
  &lt;/div&gt;
  &lt;div&gt;
  Active: &lt;input type="checkbox" id="chkActive" name="vehicle" runat="server" /&gt;
  &lt;/div&gt;
  &lt;div id="example" class="k-content"&gt;
  &lt;textarea id="editor" rows="10" cols="30" style="width:740px;height:440px"   
  runat="server"&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;div&gt;
  
  &lt;button type="button" id="btnUpdate" runat="server"   onserverclick="    
  btnUpdate_onclick" &gt;Save&lt;/button&gt;
  
  &lt;/div&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>My .cs code is</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
  {
  
  
      Bind();
  }
  
  private void Bind()
  {
      SqlConnection con = new SqlConnection("Data Source=ST0022;Initial 
  Catalog=QuickMove_Globe;User ID=sa;Password=good");
      SqlDataAdapter da = new SqlDataAdapter();
      DataSet ds = new DataSet();
      da.SelectCommand = new SqlCommand("Select * from Templates", con);
      con.Open();
      da.SelectCommand.ExecuteNonQuery();
      da.Fill(ds);
      con.Close();
      multi.DataTextField = "ID";
      multi.DataValueField = "Name";
      multi.DataValueField = "Description";
  
      multi.DataSource = ds.Tables[0];
      multi.DataBind();
  }
  
  protected void btnUpdate_onclick(object sender, EventArgs e)
  {
  
  
  
      SqlConnection con = new SqlConnection(@"Data Source=ST0022;Initial 
  Catalog=QuickMove_Globe;Persist Security Info=True;User ID=sa;Password=good");
      SqlCommand cmd= new SqlCommand("Update_Temp", con);
  
      cmd.CommandType = CommandType.StoredProcedure;
      //passing parameters
      cmd.Parameters.AddWithValue("@ID", Convert.ToInt32(multi.SelectedIndex));
      cmd.Parameters.AddWithValue("@Name",Convert.ToString(txtName.Value));
      cmd.Parameters.AddWithValue("@Description", Convert.ToString(txtComment.Value));
      cmd.Parameters.AddWithValue("@Content", Convert.ToString(editor.Value));
      cmd.Parameters.AddWithValue("@Active", (chkActive.Value).ToString());
  
      SqlDataAdapter da = new SqlDataAdapter();
  
      da.UpdateCommand=cmd;
      con.Open();
  
  
  
  
  
  
      cmd.ExecuteNonQuery();
      con.Close();
  
  }
  </code></pre>