private void Cargar_rol() { RN_Rol obj = new RN_Rol(); DataTable dt = new DataTable(); try { dt = obj.RN_Buscar_Todos_Roles(); if (dt.Rows.Count > 0) { var cbo = cbo_rol; cbo.DataSource = dt; cbo.DisplayMember = "NomRol"; cbo.ValueMember = "Id_Rol"; } cbo_rol.SelectedIndex = -1; } catch (Exception ex) { MessageBox.Show("Algo malo pasó: " + ex.Message, "Advertencia de Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void Cargar_rol() { RN_Rol obj = new RN_Rol(); DataTable dt = new DataTable(); try { dt = obj.RN_Buscar_Todos_Roles(); if (dt.Rows.Count > 0) { var cbo = cbo_rol; cbo.DataSource = dt; cbo.DisplayMember = "NomRol"; cbo.ValueMember = "Id_Rol"; } cbo_rol.SelectedIndex = -1; } catch (Exception ex) { throw; } }