public string[] CardsDescription
{
get
{
if (this.ViewState["CardsDescription"] == null)
{
this.ViewState["CardsDescription"] = new System.String[3];
return (string[])this.ViewState["CardsDescription"];
}
else
return (string[])this.ViewState["CardsDescription"];
}
set
{
this.ViewState["CardsDescription"] = value;
}
}
Thus when setting values you would use
int index = 0;
foreach(System.Data.DataRow dr in productDT.Rows)
{
int productID = int.Parse(dr["ProductID"].ToString());
this.CardsDescription[index] = dr["Description"].ToString();
index += 1;
}
No comments:
Post a Comment