ArrayList object usage with example
| Published on 8/16/2008 by Dotnetindex More articles in ASP
|
Following example is about to usage of ArrayList object. To use ArrayList in your applications, you should import System.Collections namespace. IList interface dynamically increase and decrease array. So you do not worry about array size.
Our examples are in C#
protected void btn_get_Click(object sender, EventArgs e)
{
string categoryName = string.Empty;
ArrayList categories = new ArrayList();
categoryName = "ASP";
categories.Add(categoryName);
categoryName = "ASP.NET";
categories.Add(categoryName);
categoryName = "PHP";
categories.Add(categoryName);
this.GridViewCategories.DataSource = categories;
this.GridViewCategories.DataBind();
}
|
no comments submitted



