Reputation: 95
while i am trying to bind my drop down button "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Name'." occurs. help me to overcome this. thanks in advance.
the code am using is
var at = _dbConnect.GetData_DataTable("select * from Employee a where a.department = '3' order by Name");
ddlPerson.DataSource = cat;
ddlPerson.DataTextField = "Name";
ddlPerson.DataValueField = "id";
ddlPerson.DataBind();
ddlPerson.Items.Add(new ListItem(" MY NAME ", "0"));
ddlPerson.SelectedValue = "0";
Upvotes: 0
Views: 710
Reputation: 95
var at = _dbConnect.GetData_DataTable("select * from Employee a where a.department = '3' order by Name");
ddlPerson.DataSource = **at**;
thanks for the answers and suggestions
Upvotes: 0