0
我想通過以下代碼在列表框中添加列表項 如果我錯了,請糾正我.. 下面的代碼給出了奇怪的輸出。如何在vb.net的列表框中添加列表項
Try
Dim adapter As New OleDbDataAdapter
con = New OleDbConnection(connectionString)
con.Open()
Dim dt As New DataTable
Dim ds As New DataSet
sqlstr = "select * from partyinfo "
ds.Tables.Add(dt)
adapter.SelectCommand = New OleDbCommand(sqlstr, con)
adapter.Fill(dt)
lbpartylink.DataSource = ds.Tables(0)
lbpartyunlink.ValueMember = "partyid"
lbpartyunlink.DisplayMember = "partyname"
con.Close()
Catch ex As Exception
MsgBox("error found")
End Try
什麼怪異的結果,你得到的寫
?你可以說得更詳細點嗎?在附註中,如果你從不使用它,爲什麼要創建'DataSet'? –