title: I get DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'productID'
body: <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="check.aspx.cs" Inherits="check" %&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
      &lt;title&gt;&lt;/title&gt;
   &lt;style&gt;
              h1 {
              font-family: 'Lucida Handwriting';
              text-align: center;
              margin: 50px;
              font-size: 50px;
          }
  
          .word {
              font-family: 'Lucida Handwriting';
              margin: 50px;
              font-size: 20px;
          }
  
          body {
              background-image: url("http://3.bp.blogspot.com/-3UIjuTrbAI8/Uihk5uaH_lI/AAAAAAAAAuk/gcn5XlQ9kyI/s640/Top+10+best+Simple+Awesome+Background+Images+for+Your+Website+or+Blog2.jpg");
              background-repeat: no-repeat;
              background-size: cover;
              background-attachment: fixed;
          }
  
          .topnav {
              overflow: hidden;
              background-color: black;
          }
          .transbox {
              margin: 30px;
              background-color: white;
              border: 0px;
              opacity: 0.75;
              /*filter: alpha(opacity=50);*/
          }
  
              .topnav a {
                  float: left;
                  display: block;
                  color: #f2f2f2;
                  text-align: center;
                  padding: 14px 16px;
                  text-decoration: none;
                  font-size: 17px;
              }
  
                  .topnav a:hover {
                      background-color: burlywood;
                      color: black;
                  }
  
                  .topnav a.active {
                      background-color: #4CAF50;
                      color: white;
                  }
  
          .topnar a {
              float: right;
              background-color: black;
              display: block;
              color: white;
              text-align: center;
              padding: 14px 16px;
              text-decoration: none;
              font-size: 17px;
          }
  
              .topnar a:hover {
                  background-color: burlywood;
                  color: black;
              }
  
          .txtstyle {
              width: 300px;
              padding: 12px 20px;
              margin: 8px 0;
              box-sizing: border-box;
              border: 3px solid #ccc;
              -webkit-transition: 0.5s;
              transition: 0.5s;
              outline: none;
          }
  
              .txtstyle:focus {
                  border: 3px solid #555;
              }
  
               .btnlogout {
                  width: 100px;
                  height: 30px;
                  font-family:'Lucida Handwriting';
                  float:right;
              }
       .auto-style2 {
           width: 146px;
       }
       .auto-style3 {
           width: 233px;
       }
       .auto-style5 {
           width: 172px;
       }
       .auto-style6 {
           width: 141px;
       }
       .auto-style7 {
           width: 233px;
           height: 26px;
       }
       .auto-style10 {
           width: 141px;
           height: 26px;
       }
       .auto-style11 {
           height: 26px;
           width: 140px;
       }
       .auto-style14 {
           width: 175px;
       }
       .auto-style15 {
           height: 26px;
           width: 175px;
       }
       .auto-style16 {
           height: 26px;
           width: 172px;
       }
       .auto-style17 {
           height: 26px;
           width: 146px;
       }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
  
              &lt;div class="topnar"&gt;
                  &lt;a href="adminpage.aspx"&gt;Manage&lt;/a&gt;
                  &lt;a href="orderlist.aspx"&gt;Orderlist&lt;/a&gt;
              &lt;/div&gt;
              &lt;div class="topnav"&gt;
                  &lt;a class="active" href="menuhome.aspx"&gt;Home&lt;/a&gt;
                  &lt;a href="menuchicken.aspx"&gt;Chicken &amp; Fish&lt;/a&gt;
                  &lt;a href="menupasta.aspx"&gt;Pasta&lt;/a&gt;
                  &lt;a href="menuwrap.aspx"&gt;Sandwich &amp; Wrap&lt;/a&gt;
                  &lt;a href="menuside.aspx"&gt;Side Order&lt;/a&gt;
                  &lt;a href="menusoup.aspx"&gt;Salad &amp; Soup&lt;/a&gt;
  
              &lt;/div&gt;
          &lt;div&gt;
              Order ID :
              &lt;asp:TextBox ID="txtorid" runat="server"&gt;&lt;/asp:TextBox&gt;
              Secret Code :
              &lt;asp:TextBox ID="txtcode" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;asp:Button ID="btncheck" runat="server" Text="Check" OnClick="btncheck_Click" /&gt;
              &lt;br /&gt;
              &lt;br /&gt;
              &lt;/div&gt;
              &lt;div class="transbox"&gt;
              Reservation details:
           &lt;table border="1"&gt;
               &lt;tr&gt;
                   &lt;td class="auto-style7"&gt;ID&lt;/td&gt;
                   &lt;td class="auto-style15"&gt;Reserved Date&lt;/td&gt;
                   &lt;td class="auto-style11"&gt;Reserved Time&lt;/td&gt;
                   &lt;td class="auto-style10"&gt;Name&lt;/td&gt;
                   &lt;td class="auto-style11"&gt;Handphone&lt;/td&gt;
                   &lt;td class="auto-style17"&gt;TableNumber&lt;/td&gt;
                   &lt;td class="auto-style16"&gt;Pax&lt;/td&gt;
  
               &lt;/tr&gt;
  
               &lt;asp:ListView ID="listView" runat="server"&gt;
  
                   &lt;ItemTemplate&gt;
  
                       &lt;tr&gt;
                           &lt;td&gt;&lt;%# Eval("ID") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("Datebook") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("TimeFrom") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("Name") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("Handphone") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("TableNumber") %&gt;&lt;/td&gt;
                           &lt;td&gt;&lt;%# Eval("Pax") %&gt;&lt;/td&gt;
  
  
                       &lt;/tr&gt;
                   &lt;/ItemTemplate&gt;
               &lt;/asp:ListView&gt;
  
           &lt;/table&gt;
              &lt;br /&gt;
              &lt;br /&gt;
           Food Ordered:
          &lt;table border="1"&gt;
              &lt;tr&gt;
                  &lt;td&gt;Food ID&lt;/td&gt;
                  &lt;td&gt;Food Name&lt;/td&gt;
                  &lt;td&gt;Quantity&lt;/td&gt;
                  &lt;td&gt;Price&lt;/td&gt;
                  &lt;td&gt;Total&lt;/td&gt;
  
              &lt;/tr&gt;
  
              &lt;asp:ListView ID="listView1" runat="server"&gt;
  
                  &lt;ItemTemplate&gt;
  
                      &lt;tr&gt;
                          &lt;td&gt;&lt;%# Eval("productid") %&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;%# Eval("Foodname") %&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;%# Eval("quantity") %&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;%# Eval("price") %&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;%# Eval("total") %&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/ItemTemplate&gt;
              &lt;/asp:ListView&gt;
  
          &lt;/table&gt;
  
          &lt;/div&gt;
  
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Hi, this is my code. I use subquery to combine some fields in my <strong><em>SQL-statement</em></strong> and I can't get the value after subquery. Also, I get this error:</p>
  
  <blockquote>
    <p>DataBinding: 'System.Data.DataRowView' does not contain a property
    with the name 'productID'</p>
  </blockquote>
  
  <p>Anyone know how to solve it? I had checked all the column names. This sql statement <strong>can run in MYSQL database but not in code</strong>. Thanks!!</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using System.Data.SqlClient;
  using MySql.Data.MySqlClient;
  using System.IO;
  using System.Text;
  using System.Data;
  using System.Configuration;
  
  public partial class check : System.Web.UI.Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          MySqlConnection connection = new MySqlConnection();
          MySqlCommand cmmd = new MySqlCommand();
          connection.ConnectionString = "SERVER=localhost;DATABASE=pf;UID=root;PASSWORD=password;";
          connection.Open();
          string cmdText = "SELECT * FROM booking where secret = '"+ txtcode.Text + "' and id = '"+ txtorid.Text +"'";
          MySqlDataAdapter adapt = new MySqlDataAdapter(cmdText, connection);
          DataTable t = new DataTable();
          adapt.Fill(t);
          listView.DataSource = t;
          listView.DataBind();
          listView.Visible = true;
          connection.Close();
  
          MySqlConnection Conn = new MySqlConnection("Server=localhost;Database=pf;Uid=root;Pwd=password;");
          MySqlCommand Command = new MySqlCommand();
          Conn.Open();
          Command.Connection = Conn;
          Command.CommandText = "SELECT productid, (select name from menu where id = productid)as Foodname, price, quantity, price * quantity as total from salesdetail where salesid = (select id from booking where secret = 'ypnok3bd' and id = 'SSD00000000000000001') ";
  
          string productid = Command.ExecuteScalar().ToString();
          string Foodname = Command.ExecuteScalar().ToString();
          string price = Command.ExecuteScalar().ToString();
          string total = Command.ExecuteScalar().ToString();
          DataTable d = new DataTable();
          adapt.Fill(d);
          listView1.DataSource = d;
          listView1.DataBind();
          listView1.Visible = true;
          Conn.Close();
  
      }
  
      protected void btncheck_Click(object sender, EventArgs e)
      {
  
      }
  }
  </code></pre>