private void generadatos(string pl, string en, string fech, string nom, int numnom) { con.conectar("EX"); SqlCommand cmd = new SqlCommand("[dismo].[RH_BAC]", con.conex); cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Plan", pl); cmd.Parameters.AddWithValue("@Envio", en); cmd.Parameters.AddWithValue("@fecha", fech); cmd.Parameters.AddWithValue("@Nomina", nom); cmd.Parameters.AddWithValue("@NumNomina", numnom); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(table); bac.Tables.Add(table); con.Desconectar("EX"); exp.aExcel(bac); }
private void backgroundReport_DoWork(object sender, DoWorkEventArgs e) { exp.aExcel(ds); }