title: Update Query problem in asp.net c# and Mysql using odbc
body: <p>when i specify values in my update query the query works fine and the database gets updated, but when i use parameters in my query the database does not update</p>
  
  <p>here is the code i have written</p>
  
  <pre><code>try
          {
              OdbcConnection MyConnection = new OdbcConnection(ConfigurationManager.ConnectionStrings["myconn"].ConnectionString);
  
  MyConnection.Open();
              String MyString = "UPDATE orddetpabak SET jud1=@jud1,jud2=@jud2,jud3=@jud3,adv=@adv where fil_no=@fil_no AND orderdate=@orderdate";
              OdbcCommand MyCmd = new OdbcCommand(MyString, MyConnection);
              String j1=DropDownList4.SelectedValue;
              String j2=DropDownList5.SelectedValue;
              String j3=DropDownList6.SelectedValue;
              String j4=TextBox4.Text;
              String j5 = HiddenField1.Value;
              String j6 = TextBox3.Text;
  
              MyCmd.Parameters.AddWithValue("@jud1",j1);
              MyCmd.Parameters.AddWithValue("@jud2",j2);
              MyCmd.Parameters.AddWithValue("@jud3",j3);
              MyCmd.Parameters.AddWithValue("@adv",j4);
              MyCmd.Parameters.AddWithValue("@fil_no",j5);
              MyCmd.Parameters.AddWithValue("@orderdate",j6);
  
              Response.Write(DropDownList4.SelectedValue);
              Response.Write("    " + DropDownList5.SelectedValue);
              Response.Write("    " + DropDownList6.SelectedValue);
              Response.Write("    " + TextBox4.Text);
              Response.Write("    " + HiddenField1.Value);
              Response.Write("    " + TextBox3.Text);
  
  
              MyCmd.ExecuteNonQuery();
              //MyConnection.Close();
          }
          catch(Exception epp)
          {
              Response.Write(epp);
          }
  </code></pre>
  
  <p>Please Help</p>