答案:先用一个if判断语句,判断当前用户是不是123,如果是,把用户名=123作为条件,写一个Select查询语句,找到的结果用listbox.Items.add()方法添加到listbox中;否则返回空。
if UserName==“123”
dim sqlstr as string
sqlstr=“select * from 表 where UserName=‘123'"
Dim Comm as OlebCommand
Comm.commandtext=sqlstr
Comm.执行查询的方法()
下面根据你得到的结果往listbox中添加
上一个:求VB.NET数据保存教程
下一个:VB.net与数据库连接的一个问题