How can I fill products class below with products queried from SQL Server?
public class products
{
public item[] item { get; set; }
}
public class item
{
public string id { get; set; }
public string name { get; set; }
public string price { get; set; }
}
What I am trying to achieve is a variable with type products that contain a set of products.
products productset = new products();
I am hoping to work with the variable as follow:
lableName.Text = productset.item[4].name;
Please let me know how to fill such a variable with data from SQL.