title: UPDATE STATEMENT in asp.net using c#
body: <p><P>i am using asp.net with C# as code behind
  
  <Pre><code>
     OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Documents and Settings\CJP\My Documents\Visual Studio 2005\WebSites\NewElligibleSoft\elligiblity.mdb;Persist Security Info=False");
          cn.Open();
          string sql = "UPDATE main SET s_name='"+TextBox1.Text+"',inst_code='"+DropDownList1.SelectedItem+"',ms_oms='"+Label7.Text+"',elligiblity='"+Label12.Text+"',Board='"+DropDownList5.SelectedItem+"',percentage='"+TextBox4.Text+"' WHERE elg_id = '"+DropDownList4.SelectedItem+"'";
          OleDbCommand cmd = new OleDbCommand(sql, cn);
          cmd.ExecuteNonQuery();
          cmd.Dispose();
          cn.Close();
          Response.Write("alert('DATA UPDATED')");
  </pre></code>
  <p> i am getting error on </p>
  
  <pre><code>cmd.ExecuteNonQuery();</code></pre>
  
  <p>that Data type mismatch in criteria expression.</p>