title: 'System.Data.DataRowView' in DropDownList
body: <p>I cannot bind data to a <code>Dropdown List</code>.. Can any one explain me why?
  Error is : <code>'System.Data.DataRowView' does not contain a property with the name '_DeptID'.</code>
  my code is:        </p>
  
  <pre><code>public class ClassDataManagement
  {
      public DataTable BindDropDownList(string Sql, DropDownList DropDownList)
      {
          SqlConnection cn = new SqlConnection(@"Data Source=ABID-PC;Initial Catalog=_uniManagement;Integrated Security=True");
          SqlCommand cmd = new SqlCommand(Sql, cn);
          SqlDataAdapter da = new SqlDataAdapter(cmd);
          DataTable dt = new DataTable();
          da.Fill(dt);
          if (dt.Rows.Count == 0)
          {
  
          }
          else
          {
              DropDownList.DataTextField = "Name";
              DropDownList.DataValueField = "_DeptID";
              DropDownList.DataSource = dt.DefaultView;
              DropDownList.DataBind();
          }
          return dt;
      }
  
  }
  protected void Page_Load(object sender, EventArgs e)
  {
      ClassDataManagement dm = new ClassDataManagement();
      dm.BindDropDownList("select _Program.Name from _program,_Department where _program._Deptid = _department._DeptId", DropDownListProgram);
  }
  </code></pre>