Link to home
Start Free TrialLog in
Avatar of zstafa
zstafa

asked on

How do I add contents of a column from an access database to different tetboxes?

Currently I am querying a column in a database by               "SELECT [First Name] FROM [Player] WHERE [Team]=2000";
When viewing the results with this command                        " MessageBox.Show(Convert.ToString(dbReader.GetValue(0)));"

everything works fine and I get different messageboxes for each name. (John, Terry, Chris, Jared, all in different messageboxes)
but how can I put these values in different textboxes? Any help would be great. Thanks
Avatar of Chester_M_Ragel
Chester_M_Ragel

You must loop through the values and get a collection of name. From that collection, you can fill the text box.
Avatar of zstafa

ASKER

Could you be a little more specific please. All of the values I want are in dbReader.GetValue(0) according to MessageBox.Show. Thanks alot for your help.
For example, if you are using arraylist, then you can loop throguh all the elements in dbreader and add those into an arraylist. For eg.

ArrayList al = new ArrayLsit();
while(dbReader.Read())
{
al.Add(Convert.ToString(dbReader.GetValue(0)));
}

Chester
ASKER CERTIFIED SOLUTION
Avatar of Mohammed Nasman
Mohammed Nasman
Flag of Palestine, State of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial