public VentanaRegistros(SqlConnection conexion, string query) { InitializeComponent(); SqlDataAdapter adapter = new SqlDataAdapter(query, conexion); Tabla tablaQuery = new DetalleCompra(); adapter.Fill(tablaQuery); dataGridViewRegistros.DataSource = tablaQuery; }
/*El indice del combobox principal selecciona la tabla.*/ public Form1() { InitializeComponent(); tablas[0] = new TipoTrabajo(); tablas[1] = new Cliente(); tablas[2] = new Empleado(); tablas[3] = new Confeccion(); tablas[4] = new Prenda(); tablas[5] = new Trabajo(); tablas[6] = new Material(); tablas[7] = new MaterialParaTrabajo(); tablas[8] = new Proveedor(); tablas[9] = new Compra(); tablas[10] = new DetalleCompra(); dtRow.AllowUserToAddRows = false; connectionSQL.Open(); }