Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
VB
sqlcmd.CommandText = sqlstr
sqlcmd.Connection = sqlconn
sqlda.SelectCommand = sqlcmd
sqldr = sqlcmd.ExecuteReader
ListView1.Items.Clear()
sqldr.Read()
ListView1.Items.Add(sqldr("DATE"))
sqldr.Close()


the output is this:
150
 0
100



how to put on listview the above item coming from database by this format

Listview
ColumnName: 11/24/2011  | 11/25/2011  |  11/26/2011
                150     |     0       |     100 


what will be code like above.
Posted
Updated 27-Nov-11 22:31pm
v2
Comments
RaisKazi 28-Nov-11 4:43am    
What is a significance of Dates? And how it is related to those Numbers?
Wayne Gaylard 28-Nov-11 4:49am    
You will need to show us the original command text, as well as the structure of the database table for us to answer.

Try this one :
VB
Dim LItem1,LItem2 As New ListViewItem
LItem.Text = "11/24/2011"
LItem.SubItems.Add("11/25/2011")
LItem.SubItems.Add("11/26/2011")
LItem.Text = sqldr(0)
LItem.SubItems.Add(sqldr(1))
LItem.SubItems.Add(sqldr(2))
ListView1.Items.Add(LItem1)
ListView1.Items.Add(LItem2)

Please provide more details about your question which help us to understand and provide solution on that.
 
Share this answer
 
You provided inadequate information. It would help to know your SQL statement.
 
Share this answer
 
v2

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