retrieving data from SQL in VB (part 2)

后端 未结 3 860
难免孤独
难免孤独 2021-01-14 13:24

I am trying to populate a listbox by retrieving data from a database through sql. I have asked this question earlier but i was using a different configuration and the one i\

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 13:50

    Set the DisplayMember property after DataSource binding:

    ListBox1.DataSource = dt
    ListBox1.DisplayMember="name"
    

提交回复
热议问题