开发者

VB.NET combobox displays System.Data.DataRowView

开发者 https://www.devze.com 2023-03-16 12:30 出处:网络
I used this code: myCommand = New SqlComman(\"SELECT RackName FROM tblRack\", myConnection) myAdapter = New SqlDataAdapter(myCommand)

I used this code:

 myCommand = New SqlComman("SELECT RackName FROM tblRack", myConnection)
 myAdapter = New SqlDataAdapter(myCommand)
 myAdapter.Fill(myDataSet, "tblRack")
 cboRack.DataSource = myDataSet.Tables(0)

then in the combobox i go开发者_JS百科t the display "System.Data.DataRowView". Please help


You didnt set the datavaluefield and datatextfield.

cboRack.datavaluefield = "RackName" 'Youre not using IDs ? cboRack.datatextfield = "RackName"

0

精彩评论

暂无评论...
验证码 换一张
取 消