原帖:http://hi.baidu.com/ssyj00/item/7661dcab7713b8726cd4555d
using (SqlConnection conn = new SqlConnection("server=(local);database=Northwind;user id=sa;password=sa;min pool size=4;max pool size=100;Connection Lifetime=30;"))
{
SqlDataAdapter adapter1 = new SqlDataAdapter("Select Top 10 ProductId,ProductName,UnitPrice FROM Products", conn);
DataTable table1 = new DataTable();
adapter1.Fill(table1);
给表新增加一个列再给这个列组合一个值(要绑定的字段)
table1.Columns.Add("Text", System.Type.GetType("System.String"), "ProductName+'-'+UnitPrice");
DropDownList1.DataSource = table1.DefaultView;
DropDownList1.DataTextField = "Text"; //注意要绑定自己增加的字段
DropDownList1.DataValueField = "ProductId";
DropDownList1.DataBind();
}