newby hashtable question

Discussion in 'C#' started by DariusC, Apr 29, 2008.

  1. DariusC

    DariusC New Member

    Joined:
    Apr 29, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi all
    Darius here, and as you will see from this question, Im new to the world of programming.

    Im trying to write a program that i plan on using for the registration of students. It is Winform based, and consists of 9 textboxes that I use to gather data from the user. Now I have created a student class, and a hashtable to tempereraly store the gathered data in.
    Now my Question is, how do I go about extracting the data from the hashtable, and displaying it in either a new window, or back in the original textboxes from where it came in the first place. So in other words, if I type in the student number(key) in the textBox.1, I want the values(the data from the other 8 textboxes) to reappear in those textboxes as they were entered.
    I know there is no myTable.Show method, but im sure there has to be a way to do it. Can anyone tell me how?

    Thank you all, for any and all help.
    Darius
     
  2. imported_xpi0t0s

    imported_xpi0t0s New Member

    Joined:
    Jul 18, 2008
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    0
    How have you created the hash table? Is it a file that contains the data, or an array of structures within the program?
     
  3. praspam

    praspam New Member

    Joined:
    Feb 22, 2012
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    public static bool TChekStudentIdExists(string strstudentID)
    {
    IDictionaryEnumerator en = objstudent.GetEnumerator();

    while (en.MoveNext())
    {
    string str = en.Key.ToString();
    if (str == strstudentID)
    return true;

    }
    if (objstudent.Count == 0)
    return true;
    else
    return false;
    }
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice