public Agregar_Sede() { conex_Sede = new conex_sede(); InitializeComponent(); cnx = new SqlConnection(conection); cnx.Open(); cmd = new SqlCommand("select * from Persona", cnx); cmd.ExecuteNonQuery(); dataReader = cmd.ExecuteReader(); while (dataReader.Read()) { cmb_idencargadosede.Items.Add(dataReader["ID"].ToString()); } dataReader.Close(); cmd = new SqlCommand("select * from Supermercado", cnx); cmd.ExecuteNonQuery(); dr = cmd.ExecuteReader(); while (dr.Read()) { cmb_idsupermercadosede.Items.Add(dr["ID"].ToString()); } cnx.Close(); }
public Actualizar_Sede() { InitializeComponent(); conex_Sede = new conex_sede(); cnx = new SqlConnection(conection); cnx.Open(); cmd = new SqlCommand("select * from Sede", cnx); cmd.ExecuteNonQuery(); dataReader = cmd.ExecuteReader(); while (dataReader.Read()) { cmb_idSede.Items.Add(dataReader["ID"].ToString()); } cnx.Close(); }