neha verma

neha verma

  • NA
  • 49
  • 7.8k

drop down binding

Jan 30 2019 4:46 AM
SqlCommand cmd = new SqlCommand("select FirstName+''+LastName from EmployeeMaster", con);
SqlDataAdapter dap = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
dap.Fill(ds);
ddldetails.DataSource = ds;
ddldetails.DataTextField = "FirstName+''+LastName";//Database table filed name for display in dropdown
ddldetails.DataBind();
 
 
getting an exception-
 
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'FirstName+''+LastName'. 
 
 
Please help me with this. 

Answers (4)