private void Categoria_Load(object sender, EventArgs e) { DataTable t1 = categorias.SQL(String.Format("SELECT idCategoria, nombre, descripcion FROM taller.categoria")); dataGridView2.DataSource = null; dataGridView2.DataSource = t1; dataGridView2.Refresh(); Cargar_Datos(); DataGridLectura(); }
/// <summary> /// Se cargan los datos en el combobox a la hora darle doble click al DataGrid /// </summary> public void DatosCombos() { DataTable t2 = categorias.SQL(String.Format("SELECT idCategoria, nombre, descripcion FROM " + "taller.categoria ")); cbxCategoria.DataSource = null; cbxCategoria.DataSource = t2; cbxCategoria.DisplayMember = "nombre"; cbxCategoria.ValueMember = "idCategoria"; cbxCategoria.Refresh(); DataTable t3 = proveedores.SQL(String.Format("SELECT idProveedor, RTNProveedor, nombre, telefono, " + "direccion, correoElectronico FROM taller.proveedor")); cbxProveedor.DataSource = null; cbxProveedor.DataSource = t3; cbxProveedor.DisplayMember = "nombre"; cbxProveedor.ValueMember = "idProveedor"; cbxProveedor.Refresh(); }