void Actualizar() { dataGridView1.DataSource = null; dataGridView1.Rows.Clear(); Querys query = new Querys(); String id = Txid.Text; List <VentaClas> listas = query.BuscarVentasId(id); foreach (VentaClas p in listas) { DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone(); row.Cells[0].Value = p.idVenta; row.Cells[1].Value = p.fechaPedido; row.Cells[2].Value = p.comentarios; row.Cells[3].Value = p.totalVenta; dataGridView1.Rows.Add(row); } }