cannot see values from list in c#
- by PriceCheaperton
I have the following code:
But i cannot response write the values in the list for debugging purposes...
public void LottoWinners(object sender, EventArgs e)
{
Dictionary<int, int> number = new Dictionary<int, int>();
Random generator = new Random();
while (number.Count < 6)
{
number[generator.Next(1, 49)] = 1;
}
int[] lotto = number.Keys.OrderBy(n => n).ToArray();
List<int> lst = lotto.OfType<int>().ToList();
StringBuilder builder = new StringBuilder();
for (int i = 0; i < lst.Count; i++) // Loop through List with for
{
builder.Append(lst).Append("|"); // Append string to StringBuilder
}
string result = builder.ToString(); // Get string from StringBuilder
Response.Write(result);
}
But all i see is as my result. I should be seeing the values of my list!
System.Collections.Generic.List`1