title: how to get radio button valuse and store in mysql database
body: <p>i want to store the radio button values as male and female in the mysql database, therefore i used windows store application using c#</p>
  
  <p>here is my C# code</p>
  
  <pre><code>private void addButton_Click(object sender, RoutedEventArgs e)
      {
          try
          {
              string Query = @"INSERT INTO `bcasdb`.`tbl_student`
                      (`reg_id`,
                      `std_fname`,
                      `std_lname`,
                      `tbl_batch_batch_id`,
                      `gender`) 
          VALUES (@regId, @fName, @lName, @bID, @gender)";
             //This is command class which will handle the query and connection object.
              MySqlConnection conn = new MySqlConnection(BCASApp.DataModel.DB_CON.connection);
              MySqlCommand cmd = new MySqlCommand(Query, conn);
              conn.Open();
              cmd.Parameters.AddWithValue("@regId", this.regIDInput.Text);
              cmd.Parameters.AddWithValue("@fName", this.fnameInput.Text);
              cmd.Parameters.AddWithValue("@lName", this.lnameInput.Text);
              cmd.Parameters.AddWithValue("@bID", this.batchIDInput.Text);
              //cmd.Parameters.AddWithValue("@gender", );
              cmd.ExecuteNonQuery();
              conn.Close();
              successmsgBox();
          }
          catch (Exception)
          {
              errormsgBox();
          }
      }
  
      private void genderInput_Checked(object sender, RoutedEventArgs e)
      {
  
      }
  </code></pre>
  
  <p>here is my xaml coding</p>
  
  <pre><code>&lt;StackPanel Orientation="Horizontal" Margin="20,20,0,10"&gt;
                  &lt;RadioButton Name="maleInput" Content="Male" Checked="genderInput_Checked" Width="75"&gt;&lt;/RadioButton&gt;
                  &lt;RadioButton Name="femaleInput" Content="Female" Checked="genderInput_Checked" Width="162"&gt;&lt;/RadioButton&gt;
              &lt;/StackPanel&gt;
  </code></pre>