@Armando Rodas
También puedes usar una lista genérica para poder cargar los datos en el ListView
Public Shared Function GetProductosLV() As List(Of ProductoEntity) Using cn As SqlConnection = Conexion.Conectar("default") cn.Open() Using cmd As SqlCommand = cn.CreateCommand() cmd.CommandText = "SELECT Producto_Id, Nombre FROM Productos WHERE Producto_Id > 000009" Dim producto As List(Of ProductoEntity) = new List(Of ProductoEntity)() Using reader As SqlDataReader = cmd.ExecuteReader() While reader.Read() Dim p As New ProductoEntity() Producto_Id = Convert.ToString(reader("Producto_Id")), Nombre = Convert.ToString(reader("Nombre")), End While End using producto.Add(p) End using End using Return producto End Function
Presentacion
lista = Producto.GetProductosLV() For Each row in lista Dim items As New ListViewItem(row.Producto_Id) Next items.SubItems.Add(row.Nombre) lisvProductos.Items.Add(items)
Espero te sirva de ayuda.
Nota: En tu caso no uses parámetros, modifica el ejemplo a tus necesidades.
Pedro Ávila
"El hombre sabio querrá estar siempre con quien sea mejor que él."
Lima - Perú