It seems that the mysql select parameter is being inserted with double quotes
string strEstablishments = String.Join(",", myEstablishments);
strEstablishments contains (from the VS2019 debug window)
"'1007','3'"
sqlDSselectEstablishment.SelectParameters.Add("Establishments", strEstablishments);
sqlDSselectEstablishment.SelectCommand = "SELECT EstablishID,Description FROM tblEstablishment WHERE EstablishID IN (@Establishments)";
But this doesn't give the result expected it only returns one result that the dropdown is populated with but should return two (establishments 1007 and 3)
It seems to me the double quotes around the string are being injected which would explain the returned results, I've tried removing them using strEstablishments.Replace("\"","")
with no joy.
Running the below command from MySQL directly returns the results as expected:
SELECT EstablishID,Description FROM tblEstablishment WHERE EstablishID IN ('3','1007');
Any ideas how I can get the result as expected using asp.net