Afternoon all - it's Friday th 13th so of course I am having an absolute mare!!!
The code below, 'should' create a list of items that will be used in a textbox autocomplete.
public string[] GetAutoComplete(string prefixText, int count)
{
try
{
string memberid = HttpContext.Current.Session["VDS_MemberID"].ToString();
string locationid = HttpContext.Current.Session["VDS_LocationID"].ToString();
string inhouse = HttpContext.Current.Session["VDS_Inhouse"].ToString();
string supplier = HttpContext.Current.Session["VDS_Supplier"].ToString();
string groupw = HttpContext.Current.Session["VDS_Group"].ToString();
string external = HttpContext.Current.Session["VDS_External"].ToString();
VDSORDAL.PDC_VDSOREntities autocomplete = new VDSORDAL.PDC_VDSOREntities();
var r = (from p in autocomplete.tblAutoCompletes
where p.MemberId == memberid && p.LocationId == locationid && p.ACItem.Contains(prefixText)
select p);
if (inhouse != "DoNotDisplayInhouse")
r = r.Where(p => p.ACItem == inhouse);
if (supplier != "DoNotDisplaySupplier")
r = r.Where(p => p.ACItem == supplier);
if (groupw != "DoNotDisplayGroup")
r = r.Where(p => p.ACItem == groupw);
if (external != "DoNotDisplayExternal")
r = r.Where(p => p.ACItem == external);
return r.Distinct().OrderBy(p => p.ACItem).ToString();
}
However, I am getting the question title as an error.
Can anyone suggest a way around this? Apologies..I am having a bad day.