Storing a variable in an Array.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Daniel Groh

    Storing a variable in an Array.

    Hi Sirs,
    I have the following code:

    //Method LinksPages()
    if(drPages.HasR ows)
    {
    while(drPages.R ead())
    {
    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

  • Peter Bromberg [C# MVP]

    #2
    Re: Storing a variable in an Array.

    ArrayList alPages = new ArrayList();

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

    Comment

    Working...