neha verma

neha verma

  • 1.8k
  • 49
  • 2.5k

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)