Bind multiple columns to DD list

sajjad7

New Member
I have the following code which binds a dataset of names to a drop down list....what do I need to do to bind name and job title (which is held in a different column) to the DD list?<BR><BR>The stored proc is already changed to bring back both columns...<BR><BR>many thanks, <BR><BR>'create a new Command using the CommandText and Connection object<BR> objCommand.CommandText = "Get_All_VPs"<BR> <BR> objDataReader = objCommand.ExecuteReader()<BR> <BR> lstVPs.Datasource = objDataReader<BR> lstVPs.DataValueField = "VP_ID"<BR> lstVPs.DataTextField = "Name"<BR> lstVPs.DataBind()<BR> lstVPs.SelectionMode =ListSelectionMode.Multiple<BR> <BR> objDataReader.close()<BR> objConnect.close()Create a datatable with datarows and datacolumns, populating your datarows with the formated data you want from your database. Then instead of binding the reader to the dropdown, bind the datatable.
 
Back
Top