Mostrar ListView

18/10/2004 - 06:38 por Fernando | Informe spam
Amigos quiero hacer lo siguiente a ver si alguien me puede
ayudar mostrar asi :

atributo1 atributo2 atributo3 atributo4

pero nose como hacerlo saco las un select * tabla
y mediante un for :
Dim Fila As DataRow
For Each fila In tabla.Rows
Me.ListView1.Items.Add(fila.Item("atributo1"),1)
Me.ListView1.Items.Add(fila.Item("atributo1"),2)
Me.ListView1.Items.Add(fila.Item("atributo1"),3)
Next
Perdone pero aun estoy conociendo el Lenguaje gracias a
todos.. :)
 

Leer las respuestas

#1 Jorge Serrano [MVP VB]
18/10/2004 - 13:35 | Informe spam
Hola Fernando,

yo para hacer eso, utilizo normalmente un DataSet y recorro la selección y
añado los campos.

Algo similar a lo que comentas con el dataset sería:

Dim Row
intContador = 1
For Each Row In objDS.Tables("Ejemplo").Rows
ListView1.Items.Add(Row(0), intContador)
intContador = intContador + 1
Next

Espero que te sirva.

Un saludo,

Jorge Serrano Pérez
Microsoft MVP VB.NET
http://www.portalvb.com/
http://weblogs.golemproject.com/jorge/


"Fernando" wrote:

Amigos quiero hacer lo siguiente a ver si alguien me puede
ayudar mostrar asi :

atributo1 atributo2 atributo3 atributo4

pero nose como hacerlo saco las un select * tabla
y mediante un for :
Dim Fila As DataRow
For Each fila In tabla.Rows
Me.ListView1.Items.Add(fila.Item("atributo1"),1)
Me.ListView1.Items.Add(fila.Item("atributo1"),2)
Me.ListView1.Items.Add(fila.Item("atributo1"),3)
Next
Perdone pero aun estoy conociendo el Lenguaje gracias a
todos.. :)

Preguntas similares