I created a WCF App. I am returning a list. I am trying to figure out how to return it to a variable on my client page. I also need to read the values.
2 boolean values are returned
- MustChangePassword
- IsAdmin
C#ASP.NET.NET Programming
Last Comment
CipherIS
8/22/2022 - Mon
Bill Nolan
Your question is unclear. Are you saying that "LoginResults" consists of two booleans? And why would you receive a list of results from a single login?
CipherIS
ASKER
the sproc returns two values. Because of this I am returning both values in a list which contains the two values.
And yes, LoginResults (as I said) contains two values: MustChangePassword, IsAdmin.
I did not design the sproc - I have to code to it. So I must obtain the values to determine what I have to do on the ASP.NET page.
Bill Nolan
What you actually said was "2 boolean values are returned". Looking at your function call, it is evident that it returns a list - NOT two boolean values. Are you actually getting two different login results, EACH containing two booleans? It is still unclear.
I have no idea what is going on at your end. However, it seem that regardless, you probably simply need to iterate the list and get your values:
foreach (LoginResults results in myresults)
{
// Do something with 'results'
if (results.bValue1 == true) whatever;
}