I want to show the values that I get from a query, I keep them in a 'List' but it does not show me anything:
private void getValues2()
{
List<string> list2 = new List<string>();
cn.Open();
SqlCommand cmd = new SqlCommand("SELECT SUM(Qty) AS QTY FROM tbl_Kanban GROUP BY Part_Num", cn);
SqlDataReader leer;
leer = cmd.ExecuteReader();
while (leer.Read() == true)
{
list2.Add(leer[0].ToString());
}
if (list2.Count > 0)
{
}
cn.Close();
}