Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net listview中的项目加载不显示_Vb.net_Listview_Ms Access 2003 - Fatal编程技术网

Vb.net listview中的项目加载不显示

Vb.net listview中的项目加载不显示,vb.net,listview,ms-access-2003,Vb.net,Listview,Ms Access 2003,在listview中查看项目时出现问题 这是我的密码 rs.Open(“从tableStudentRecords,tableTransaction,tablePayments中选择tableStudentRecords.*,tableTransaction.*,tablePayments.*”&_ “其中tableStudentRecords.studnum=tableTransaction.studnum和tablePayments.psitCode=tableTransaction.psit

在listview中查看项目时出现问题 这是我的密码

rs.Open(“从tableStudentRecords,tableTransaction,tablePayments中选择tableStudentRecords.*,tableTransaction.*,tablePayments.*”&_
“其中tableStudentRecords.studnum=tableTransaction.studnum和tablePayments.psitCode=tableTransaction.psitCode”,con,3,3)
尺寸i为整数=0
有lvPaymentRecords
直到记录EOF为止
.Items.Add(rec(“tableTransaction.studnum”).Value)
x=rec(“sname”).Value&“,”和rec(“fname”).Value和“&rec(“mi”).Value和“&rec(“ext”).Value
.项目(i).子项目.添加(x)
lvPaymentRecords.Items(i).SubItems.Add(记录(“sem”).值)
.项目(i).子项目.添加(记录(“sy”).值)
.项目(i).子项目.增加(记录(“总计”).价值)
i=i+1
记录MoveNext()
环
以
记录关闭()
con.Close()

问题是,项目不会出现在listview中,我不知道原因是什么, tableStudentRecords和TablePayment都是主键, 下面是数据库关系 (很抱歉,由于声誉不佳,我无法发布该图像)

表数据中心记录表交易表支付表

-studnum uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu

-sname\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu-sem

-fname(名称)(名称)(名称)(名称)(名称)(名称)(名称)(名称)(名称)(名称)(名称

-gndr-总额-总额-金额


我只需要在listview加载中查看tablePayments中的sem,

您必须声明ListViewItem变量。代码应该是

 Dim lpRec As ListViewItem
    With lvPaymentRecords
        Do Until rec.EOF
            lpRec=.Items.Add(rec("tableTransaction.studnum").Value)
            x = rec("sname").Value & ", " & rec("fname").Value & " " & rec("mi").Value & " " & rec("ext").Value
            lpRec.SubItems.Add(x)
            lpRec.SubItems.Add(rec("sem").Value)
            lpRec.Items(i).SubItems.Add(rec("sy").Value)
            lpRec.Items(i).SubItems.Add(rec("total").Value)
            i = i + 1
            rec.MoveNext()
        Loop
    End With
    rec.Close()
    con.Close()

希望它能帮助您。

listview的代码在哪里?对不起,不要编辑