Hello Sir,
string AgencyIds = "";
List<SelectListItem> objList = new List<SelectListItem>();
objList = "This "objList" variable contain stored procedure result that is list of ids";
foreach (var items in objList)
{
AgencyIds = AgencyIds + items.agencyID + ",";
}
Output of the AgencyIds is like this:- 14,14,14,14,15,16,11,11,11 like that...
how to get distinct 'items.agencyID' (ie, AgencyIds) with comma for each AgencyIds using c# code?
But I want output like this:= AgencyIds = 14,15,16,11, like that...