Hello,
I have a stored procedure, when I execute it with the right parameter it returns 3 user names like this in one row in SQL:
User1 -- User2 ---User3
John---- Mike-----Jim
I am trying to display this complete list of users in a field on the webpage as shown above in the row. However when I pass the necessary parameter from the website to SQL, I only get the first name back, in this case John. Here is the Dapper ORM code that calls the stored procedure:
public List<String> GetUsers(string locNo)
{
List<String> Users = new List<String>();
using (IDbConnection conn = GetConnection())
{
try
{
var parameters = new DynamicParameters();
parameters.Add("@LocNo", locNo);
conn.Open();
Users = conn.Query<String>("dbo.spGetUsers",
param: parameters,
commandType: CommandType.StoredProcedure).ToList();
}
catch (Exception e)
{
throw e;
}
return Users; //Users only contain the first user and 2 other users are missing, I need a list of all 3 users here.
}
}
Thanks