title: C# Switch statement querying MYSQL database
body: <p>I am trying to build a program that if user selects something from dropdown then a label will show depending on what is selected.</p>
  
  <p>EG: </p>
  
  <p>selects Dog from dropdown the label will show "Dog is £20"</p>
  
  <p>selects Cat from dropdown the label will show "Cat is £15"</p>
  
  <p>I am not doing it correct and have been at it for hours any help would be much appreciated.</p>
  
  <p><strong>Code so far</strong></p>
  
  <pre><code>DataSet ds = new DataSet();
  MySqlConnection cs = new MySqlConnection(@"SERVER= 000.000.00.000;username=myusername;password=******; Initial Catalog = mydatabase");
  MySqlDataAdapter da = new MySqlDataAdapter();
  
  protected void Page_Load(object sender, EventArgs e)
  {
     MySqlCommand cd = new MySqlCommand("SELECT * FROM pets", cs);
     cs.Open();
     MySqlDataReader ddl = cd.ExecuteReader();
     DdPetPist.DataSource = ddl;
     DdPetPist.DataValueField = "Specie";
     DdPetPist.DataTextField = "Specie";
     DdPetPist.DataBind();
     cs.Close();
     cs.Dispose();
  }
  </code></pre>
  
  <p><strong>Select Index Change</strong></p>
  
  <pre><code>protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
  {
     MySqlCommand cd = new MySqlCommand("SELECT CAST(Specie AS varchar) + '#' + CAST(Specie_Price AS varchar) AS Specie FROM pets", cs);
     cs.Open();
     PetPrice.Text = Convert.ToString(cd.ExecuteReader());
     cs.Close();
  }  
  </code></pre>
  
  <p>Please any help will be great I have been stuck on this problem for hours and would like to move on to my next task at hand.</p>