
20/01/2009, 19:43
|
| | Fecha de Ingreso: enero-2009
Mensajes: 6
Antigüedad: 16 años, 1 mes Puntos: 0 | |
Ayuda Soy novato miren pues estoy haciendo una aplicacion en visual basic 2005 y pues estoy agregando datos de la base de datos a un listview pero todos me los agrega en cola y quiero que se separen cuando le doy otro codigo
asi me los da
1 5 5 6 5 6 5 5 555 5 5 55 5 5 5 todos asi y yo quiero que nomas de 3 en tres
que al llegar ala columna 3 se vaya a otra fila.
123
456 asiiii
jejej perdone si soy tan explicativo jajaja ni yo me entiendo pero pues alguna ayuda se los agradeceria aqui les dejo el codigo
Imports System.Data.OleDb
Public Class Form1
Dim total As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ConexionConBD As OleDbConnection = New OleDbConnection
ConexionConBD.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\tienda\tienda.mdb"
Dim Orden As OleDbCommand = New OleDbCommand
Dim Lector As OleDbDataReader = Nothing
Dim Consulta As String
ConexionConBD.Open()
Consulta = "SELECT clave, producto,precioventa FROM altas WHERE clave= " & TextBox1.Text & ""
Orden = New OleDbCommand(Consulta, ConexionConBD)
Lector = Orden.ExecuteReader()
While Lector.Read
With ListView1.Items.Add(Lector.Item("clave").ToString)
ListView1.Items.Add(Lector.Item("producto").ToStri ng)
ListView1.Items.Add(Lector.Item("precioventa").ToS tring)
If (Lector.GetValue(2) < 10000000) Then
total = Lector.GetValue(2) + total
TextBox2.Text = total
End If
End With
End While
End Sub |