我使用了这段代码:
myCommand = New SqlComman("SELECT RackName FROM tblRack", myConnection)
myAdapter = New SqlDataAdapter(myCommand)
myAdapter.Fill(myDataSet, "tblRack")
cboRack.DataSource = myDataSet.Tables(0)
然后在组合框中我得到了显示“System.Data.DataRowView”。请帮忙
答案 0 :(得分:1)
您没有设置datavaluefield和datatextfield。
cboRack.datavaluefield =“RackName”'您没有使用ID? cboRack.datatextfield =“RackName”