1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Help with collection ArrayList conversion

Discussion in 'C#' started by markyjj, Apr 22, 2006.

  1. markyjj

    markyjj New Member

    Can someone please give me some advise on the following.

    I am currently doing a project where I have to store students records and I have to retrieve

    these records. This has to be done by using windows forms with C#. My idea is, is to use a

    collection array list to store the records. In the form I want to add code for a button

    click event that displays the records within the textboxes of the form when a record is

    retrieved from the collection array List. The problem that I have however, is how to

    convert the entered string to be displayed in the text box. For example, if the entered

    string is 'science' and stored in the collection array list called RegList. When I try to

    display this string in the text box, the fully qualified name is displayed, i.e

    System.Windows.Forms.TextBox, Text: science.

    I just want the entered string to be displayed.

    This is the conversion code that I use to display the code in the textbox:

    txtFirstnm.Text = RegList[1].ToString();

    'txtFirstnm' is the name of the text box and 'RegList' is the collection array list.

    I hope someone can assist with this it would be of great help. Thanks
     
  2. shabbir

    shabbir Administrator Staff Member

    Just write txtFirstnm.Text = RegList[1] and not txtFirstnm.Text = RegList[1].ToString()
     

Share This Page