title: How to Put two DataValueFields?
body: <p>How do I bind a product name, then get a product id and price in the label result? The three attributes are from the same table in DB.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>public partial class CreateOrder : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          if (Page.IsPostBack == false) bindListBox();
      }
  }
  
  private void bindListBox()
  {
      ddlProduct.DataSource     = getReader();
      ddlProduct.DataTextField  = "productName";
      ddlProduct.DataValueField = "IDANDPRICE"; 
  
      ddlProduct.DataBind();
  }
  
  private SqlDataReader getReader()
  {
      //get connection string from web.config
      string strConnectionString =
          ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
      SqlConnection myConnect = new SqlConnection(strConnectionString);
  
      string strCommandText = "SELECT productName, productID,productPrice,(productID + '-' +  productPrice) AS IDANDPRICE from Product";
      SqlCommand cmd = new SqlCommand(strCommandText, myConnect);
  
      myConnect.Open();
  
      SqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
      return reader;
  }
  
  protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
  {
      Label1.Text = "";
      Label1.Text += "productName:" + ddlProduct.SelectedItem.Text + "&lt;br/&gt;";
  
      Label2.Text = "";
      Label2.Text += "IDANDPRICE:" + ddlProduct.SelectedItem.ToString() ;
  
  }
  </code></pre>