开发者

vb.net retrieving information from access to list box

开发者 https://www.devze.com 2023-01-23 17:25 出处:网络
Am using MS Access as my back end and I am having a table called \"Dept\" with 2 columns (dename & cname). In Vb.Net when I click a com开发者_开发问答mand button, all the data\'s of the first colu

Am using MS Access as my back end and I am having a table called "Dept" with 2 columns (dename & cname). In Vb.Net when I click a com开发者_开发问答mand button, all the data's of the first column should be displayed in ListBox1 and the Second column in ListBox2. I do not know how to proceed, Can any one help ?


why not do something like this.

dim data as datatable = (function to retrive information)

Listbox1.datasource = data
Listbox.DataTextField = "ColumnName1"
Listbox1.databind()

Listbox2.datasource = data
ListBox2.DataTextField = "ColumnName2"
Listbox2.databind()
0

精彩评论

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

关注公众号