protected void Button1_Click(object sender, EventArgs e) { string cs = ConfigurationManager.ConnectionStrings["EjDB"].ConnectionString; using (SqlConnection con = new SqlConnection(cs)){ SqlDataAdapter da = new SqlDataAdapter("pEmpleadosPorEmpresas", con); da.SelectCommand.CommandType = CommandType.StoredProcedure; da.SelectCommand.Parameters.AddWithValue("@empresa", Localidad.Text); DataSet ds = new DataSet(); da.Fill(ds); GVEmpleado.DataSource = ds; GVEmpleado.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { GVEmpleado.DataSource = CADEmpresa.CogerEmpleado(); GVEmpleado.DataBind(); }