หลังจากโหลด db ใน mysql ลง listview แล้วมันเป็นแบบนี้ บางอันหายไป มันเกิดจากอะไรคับ
โค้ดที่ผมให้เรียก mysql ลง listview Code (VB.NET)
Public Sub LoadList()
Dim SQL_Connection As MySqlConnection = New MySqlConnection("Database=XXXXX;Server=localhost;User Id=root;Password=12345;Pooling=false")
Dim sqlQuery As String = "SELECT * FROM data"
Dim sqlAdapter As New MySqlDataAdapter
Dim sqlCommand As New MySqlCommand
Dim Table As New DataTable
Dim i As Integer
SQL_Connection.Open()
With sqlCommand
.CommandText = sqlQuery
.Connection = SQL_Connection
End With
With sqlAdapter
.SelectCommand = sqlCommand
.Fill(Table)
End With
ListView1.Items.Clear()
For i = 0 To Table.Rows.Count - 1
Dim ImageStatusStr As String = Table.Rows(i)("Status")
Dim ImageStatus As Integer
ListView1.SmallImageList = ImageList1
With ListView1
.Items.Add(Table.Rows(i)("Com_name"), ImageStatus)
With .Items(.Items.Count - 1).SubItems
.Add(Table.Rows(i)("Check_in"))
.Add(Table.Rows(i)("Check_out"))
.Add(Table.Rows(i)("Sum_Time"))
.Add(Table.Rows(i)("Sum_Amount"))
.Add(Table.Rows(i)("Status"))
.Add(Table.Rows(i)("Com_IP"))
End With
End With
Next
SQL_Connection.Close()
End Sub