Solo muéstrame los valores que la CI=123456 mira mi codigo a ver si me entiendes,
En esta parte solo carga los valores de la tabla al table view
' gambas class file
PUBLIC cn AS NEW Connection
PUBLIC rs AS Result
PUBLIC SUB Form_Open()
DIM row AS Integer = TableView1.Rows.Count
DIM i AS Integer
ME.Center
WITH cn
.type = "mysql"
.host = "localhost"
.login = "root"
.Password = "6419148"
.name = "hola"
TRY .Open
IF ERROR THEN
Message.Error("Error en la conexion")
ME.Close
ELSE
rs = cn.Exec("SELECT * FROM Compras")
END IF
END WITH
TableView1.Columns.Count = 3
TableView1.Columns[0].Text = "CI"
TableView1.Columns[0].Width = 130
TableView1.Columns[1].Text = "Nombre del Articulo"
TableView1.Columns[1].Width = 130
TableView1.Columns[2].Text = "Cantidad"
TableView1.Columns[2].Width = 130
TableView1.Clear
TableView1.Rows.Count = rs.Count
FOR i = 0 TO (rs.Count - 1)
TableView1[i, 0].Text = rs["CI"]
TableView1[i, 1].Text = rs["Nombre_medicamento"]
TableView1[i, 2].Text = rs["cantidad"]
rs.MoveNext
NEXT
END
PUBLIC SUB Button1_Click()
ME.Close
END
PUBLIC cn AS NEW Connection
PUBLIC rs AS Result
PUBLIC SUB Form_Open()
DIM row AS Integer = TableView1.Rows.Count
DIM i AS Integer
ME.Center
WITH cn
.type = "mysql"
.host = "localhost"
.login = "root"
.Password = "6419148"
.name = "hola"
TRY .Open
IF ERROR THEN
Message.Error("Error en la conexion")
ME.Close
ELSE
rs = cn.Exec("SELECT * FROM Compras")
END IF
END WITH
TableView1.Columns.Count = 3
TableView1.Columns[0].Text = "CI"
TableView1.Columns[0].Width = 130
TableView1.Columns[1].Text = "Nombre del Articulo"
TableView1.Columns[1].Width = 130
TableView1.Columns[2].Text = "Cantidad"
TableView1.Columns[2].Width = 130
TableView1.Clear
TableView1.Rows.Count = rs.Count
FOR i = 0 TO (rs.Count - 1)
TableView1[i, 0].Text = rs["CI"]
TableView1[i, 1].Text = rs["Nombre_medicamento"]
TableView1[i, 2].Text = rs["cantidad"]
rs.MoveNext
NEXT
END
PUBLIC SUB Button1_Click()
ME.Close
END
Y en esta parte es donde restrinjo los valores que se van a cargar
PUBLIC SUB Button2_Click()
DIM i AS Integer
TableView1.Clear
TableView1.Rows.Count = rs.Count
FOR i = 0 TO (rs.Count - 1)
TableView1[i, 0].Text = rs["CI ='" & textbox1.text & "';"]
TableView1[i, 1].Text = rs["Nombre_medicamento where CI='" & textbox1.text & "';"]
TableView1[i, 2].Text = rs["cantidad where CI='" & textbox1.text & "';"]
rs.MoveNext
NEXT
END
DIM i AS Integer
TableView1.Clear
TableView1.Rows.Count = rs.Count
FOR i = 0 TO (rs.Count - 1)
TableView1[i, 0].Text = rs["CI ='" & textbox1.text & "';"]
TableView1[i, 1].Text = rs["Nombre_medicamento where CI='" & textbox1.text & "';"]
TableView1[i, 2].Text = rs["cantidad where CI='" & textbox1.text & "';"]
rs.MoveNext
NEXT
END