Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello how do to the value in column viewed is 1 or 0 to load the listview for example if it is 0 then item will not load but is value it 1 i displayed in the lists view ?



Code:



Sub showData()

ds = New DataSet
da = New MySqlDataAdapter("Select * from tblinfo", sqlcon)
da.Fill(ds, "tblinfo")
da = New MySqlDataAdapter("Select * from users", sqlcon)
da.Fill(ds, "users")

lvDisplay.Items.Clear()
If ds.Tables("tblinfo").Rows.Count > 0 Then
For i As Integer = 0 To ds.Tables("tblinfo").Rows.Count = 1
With lvDisplay.Items.Add(ds.Tables("tblinfo").Rows(i).Item(0).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(1).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(2).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(3).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(4).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(5).ToString)
.SubItems.Add(ds.Tables("tblinfo").Rows(i).Item(7).ToString)


End With
Next

End If

End Sub


http://s30.postimg.org/icvbm3jch/reete.png

http://s27.postimg.org/pfvw2uaeb/reterte.png
Posted
Comments
[no name] 16-Aug-14 15:10pm    
See comment to the "question" you deleted.

1 solution

If you have view column in your table then you can use where condition to filter and display in list view. just use:
SQL
where view = 1
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900