Showing many columns in one DropDownlist

shahab

Junior Contributor
Joined
Aug 14, 2003
Messages
206
Location
Iran(Middle East)
Is it posible to bind and show more than one column of msSql database in just one DDL?
Code:
void DDL1Binder()
		{
			
			string strCon = ConfigurationSettings.AppSettings["ConnStr"]; 
			SqlConnection wg = new SqlConnection(strCon); 
			
			SqlDataAdapter dtAdap1 = new  
				SqlDataAdapter("select a,b,c from tbl ",wg); 
			  
			dtAdap1.Fill(ds1, "tbl");				
			DropDownList1.DataSource = ds1.Tables["tbl"].DefaultView;
			DropDownList1.DataBind();
	
		}
Is it possible to show a,b,c all together in DropDownList1?
Code please:)
 
you should add a column to your datasource which is the concatination of the columns you want and bind the ddl's displaymember property to that column
 
Back
Top