asp.net DropDownList 绑定的值读出来都是类型

用DropDownList 动态绑定数据库某一列的值,读出来都是类型如下图所示:图片说明

该怎么解决啊?

你确认是绑定的?怎么感觉你是动态增加的,如 dd.Items.Add(ListItem),然后ListItem的值设置错了,设置为DataRowView对象了,而不是数据行的值
发你如何绑定的代码看看

你绑定对么?ddl.DataSource = dt;
ddl.DataTextField = "Name";
ddl.DataValueField = "ID";
ddl.DataBind();

可以参考以下链接

http://zhidao.baidu.com/link?url=olceXWF52rukkw-sV-w07COl0UbQISEW70AV9H636KUzyNmgHr9OG6IsXQ812ZTV3jj4LkeujI_tkD0tt-ZBF_

ASP.NET dropdownlist绑定数据却显示System.Data.DataRowView

问题: 在VS中用dropdownlist控件绑定数据,浏览时却在控件里显示System.Data.DataRowView,而不是要显示的数据,代码如下:

public static DataSet GetDataSet(DataSet ds, string tablename)
{
string s = "select departmentName from department_info";
string con = ConfigurationManager.ConnectionStrings["CodematicConnectionString"].ConnectionString.ToString();
SqlConnection conn = new SqlConnection(con);
SqlDataAdapter adapter = new SqlDataAdapter(s, con);
adapter.Fill(ds, tablename);
return ds;
}

protected void Page_Load(object sender, EventArgs e)
{

     if(!IsPostBack)

       { 
           DataSet ds = new DataSet(); 
           string tablename = "department_Info"; 
           ds = GetDataSet(ds, tablename); 
           this.ddl_post.DataSource = ds; 
                  this.ddl_post.DataBind(); 
           DataTable dt = ds.Tables[0]; 
           DataRow dr = dt.NewRow(); 
           dr[0] = "==请选择=="; 
           //添加到第1行 
           dt.Rows.InsertAt(dr, 0); 
           this.ddl_post.DataSource = dt; 
           //这种方法也可以 
           //this.ddl_department.Items.Insert(0,"==请选择=="); 
           //this.ddl_department.Items.FindByText("==请选择==").Selected = true;

       } 

 }

解决:在DataBind();前加上

     ddl_post.DataTextField = "departmentName"; 
          ddl_post.DataValueField = "departmentName";

就可以了.

链接

http://www.cnblogs.com/tangge/archive/2012/05/15/2502233.html