dazza12345
Programmer
Hi all, im using an array to add values to a listbox. The array comes from values in a database. Once the values are added to the array, the follwoing lines of code add the values in the array to the listbox.
The array at present holds the Forename and Surname of the accountant in the database. Is tehre any way of getting the name to be displayed in the listbox (i.e. the text), but have the value of the text box as something else (say the accountantID)?
Is there any way of creating an array that not only holds the name from the database but also the userID?
Cheers
Code:
string[] accountantArray;
accountantArray = AgentDetailsDataFunctions.GetAllAgentDetails(userID, "accountant");
AccountantList.DataSource = accountantArray;
AccountantList.DataBind();
AccountantList.Items.FindByText("Add new accountant").Selected = true;
The array at present holds the Forename and Surname of the accountant in the database. Is tehre any way of getting the name to be displayed in the listbox (i.e. the text), but have the value of the text box as something else (say the accountantID)?
Is there any way of creating an array that not only holds the name from the database but also the userID?
Cheers