Hello,
I like to combine 2 fields, "FirstName" + "LastName" as "FullName" to display in combobox with the fieldID as the valuemember. At the moment, I'm returning DataTable with list of fields.
public DataTable SelectAllStaff()
{
ResultsetFields fields = new ResultsetFields(2);
fields[0] = StaffFields.StaffId;
// Want to combine like the following:
// fields[1] = StaffFields.FirstName + " " + StaffFields.LastName;
using (DataAccessAdapter adapter = new DataAccessAdapter())
{
DataTable tbl = new DataTable();
adapter.FetchTypedList(fields, tbl, null);
return tbl;
}
}
And I'm getting error on this line: fields[1] = StaffFields.FirstName + " " + StaffFields.LastName;
Cannot implicitly convert type 'SD.LLBLGen.Pro.ORMSupportClasses.Expression' to 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityField2'. An explicit conversion exists (are you missing a cast?)
Is there a way to dynamically combine two fields instead of writing storeproc for that and call it using RetrivalProcedure calls? Or any other ways to solve this please?