title: retrieving radioButton value from SQL Server using C#
body: <p>I'm trying to retrieve a radioButton value from database from SQL Server Compact
  But my code doesn't work and an error message shows (<code>unable to cast object of type 'System.Data.SqlServerCe Command' to type 'System.IConvertible</code>) at line (<code>genderval = Convert.ToBoolean(gendercmnd);</code>)
  .. what is wrong? 
  thanks</p>
  
  <pre><code>if (con.State != ConnectionState.Open)
      con.Open();
  
  Boolean genderval = false;
  SqlCeCommand gendercmnd = new SqlCeCommand(@"SELECT Gender FROM Std_info WHERE Std_id='" + TextBox1.Text + "'", con);
  genderval = Convert.ToBoolean(gendercmnd);
  if (genderval == true)
      Convert.ToBoolean(radioButton1.Checked);
  else
      Convert.ToBoolean(radioButton2.Checked);  
  con.Close();
  </code></pre>