0
MS Access 데이터베이스에서 항목을 표시하려고하는 중 일부 이유는 찾을 수없는 이유는 내 목록보기 모든 레코드를 표시하지만 일부 단풍 어쩌면 당신의 일부가 이유를 알고 ... 나는 완전히 잃었어요VB.net 비어있는 레코드 목록보기에서
Public Sub LoadItems()
If tcOverzicht.SelectedIndex = 0 Then
Dim strQuery As String = "SELECT tblItems.itemID, tblItems.Referentie, tblType.Type, tblItems.Stock, tblItems.Barcode, tblItems.Omschrijving, tblItems.Merk, tblItems.Opmerking " & _
"FROM tblItems INNER JOIN tblType ON tblItems.typeID = tblType.typeID WHERE tblItems.typeID=" & intType & ";"
Dim da As New OleDbDataAdapter
Dim cmd As New OleDbCommand(strQuery, cnConnectie)
Dim TABLE As New DataTable
With da
.SelectCommand = cmd
.Fill(TABLE)
End With
'Listview leeg maken
lvItems.Items.Clear()
'Listview vullen met de gegevens uit de DB
For i As Integer = 0 To TABLE.Rows.Count - 1
With lvItems
.Items.Add(TABLE.Rows(i)("itemID"))
With .Items(.Items.Count - 1).SubItems
.Add(TABLE.Rows(i)("Referentie"))
.Add(TABLE.Rows(i)("Type"))
.Add(TABLE.Rows(i)("Stock"))
.Add(TABLE.Rows(i)("Barcode"))
.Add(TABLE.Rows(i)("Omschrijving"))
.Add(TABLE.Rows(i)("Merk"))
.Add(TABLE.Rows(i)("Opmerking"))
End With
End With
Next
End If
If tcItems.SelectedIndex = 0 Then
Dim strQuery As String = "SELECT tblItems.itemID, tblItems.Referentie, tblType.Type, tblItems.Stock, tblLeveranciers.Leverancier, tblItems.Barcode, tblItems.MinStuks,tblItems.Omschrijving, tblItems.Merk, tblItems.Opmerking " & _
"FROM (tblItems INNER JOIN tblLeveranciers ON tblItems.leveranciersID = tblLeveranciers.leveranciersID) INNER JOIN tblType ON tblItems.typeID = tblType.typeID;"
Dim da As New OleDbDataAdapter
Dim cmd As New OleDbCommand(strQuery, cnConnectie)
Dim TABLE As New DataTable
With da
.SelectCommand = cmd
.Fill(TABLE)
End With
'Listview leeg maken
lvArtikel.Items.Clear()
'Listview vullen met de gegevens uit de DB
For i As Integer = 0 To TABLE.Rows.Count - 1
With lvArtikel
.Items.Add(TABLE.Rows(i)("itemID"))
With .Items(.Items.Count - 1).SubItems
.Add(TABLE.Rows(i)("Referentie"))
.Add(TABLE.Rows(i)("Type"))
.Add(TABLE.Rows(i)("Stock"))
.Add(TABLE.Rows(i)("Leverancier"))
.Add(TABLE.Rows(i)("Barcode"))
.Add(TABLE.Rows(i)("MinStuks"))
.Add(TABLE.Rows(i)("Omschrijving"))
.Add(TABLE.Rows(i)("Merk"))
.Add(TABLE.Rows(i)("Opmerking"))
End With
End With
Next
End If
End Sub
: 빈
http://img10.imageshack.us/img10/724/52264945.png
여기 recods 난 내 항목을로드하는 데 사용하는 서브입니까?
인사말
빈 항목은 임의로, 두 번째 줄마다 모두 함께 있습니까? – grahamj42
글쎄 그들은 무작위가 아니지만 매 두 번째 줄이 아니다. – Tooz
결과가 반복 가능합니까? 문제를 설명 할 수있는 데이터에 null 필드가 있습니까? – grahamj42