Storing a variable in an Array.

  • Thread starter Thread starter Daniel Groh
  • Start date Start date
D

Daniel Groh

Hi Sirs,
I have the following code:

//Method LinksPages()
if(drPages.HasRows)
{
while(drPages.Read())
{
string strAdress = "<a href='" + drPages["Adress"] + "'>" + drPaginas["Page"] + "</a> &nbsp;&nbsp;"; //This should be an Array
}
}
This is a method and when I call it, It should return: "Home Careers Contact......"

But It returns just the last record: Contact

How do I store all the records in an array ? How do I call this method as an array ?

Thanks

Daniel
 
ArrayList alPages = new ArrayList();

while(drPages.Read())
{
string strAdress = "<a href='" + drPages["Adress"] + "'>" +
drPaginas["Page"] + "</a> &nbsp;&nbsp;"; //This should be an Array
alPages.Add(strAddress);
}
 
Back
Top