public DataSet GetAll(string empresaid, tb_estado BE) { using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid))) { using (SqlCommand cmd = new SqlCommand("gspTbEstado_SEARCH", cnx)) { DataSet ds = new DataSet(); { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@sigla", SqlDbType.Char, 4).Value = BE.sigla; cmd.Parameters.Add("@tabla", SqlDbType.Int).Value = BE.tabla; } try { cnx.Open(); using (SqlDataAdapter da = new SqlDataAdapter(cmd)) { da.Fill(ds); } return ds; } catch (Exception ex) { throw new Exception(ex.Message); } } } }
void CargarEstado2() { tb_estadoBL BL = new tb_estadoBL(); tb_estado BE = new tb_estado(); DataTable dt = new DataTable(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; cmb_estado01.DataSource = dt; cmb_estado01.ValueMember = "estado"; cmb_estado01.DisplayMember = "estadoname"; }
public DataSet GetAll(string empresaid, tb_estado BE) { return tablaDA.GetAll(empresaid, BE); }