# Looping through assemblies in a dashboard **Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5) **Created:** 2016-09-25 22:36 UTC **Views:** 1181 **Replies:** 6 **URL:** https://www.epiusers.help/t/looping-through-assemblies-in-a-dashboard/35553 --- ## Post #1 by @DurangoBurke If I'm looping through a list of Assemblies from a dashboard, how do I pass multiple parameters...such as the JobNum(str) and the AssemblySeq (int)? --- ## Post #2 by @josecgomez I moved this to a new topic since it isn't related to the previous question, makes it easier to keep organized! --- ## Post #3 by @josecgomez What do you mean multiple parameters? What does your loop look like? --- ## Post #4 by @DurangoBurke If I was looping through a independent record set and needed to pass both a JobNum and the assembly seq in order to get the correct selected assembly to update. I can't see how the following code would know which JobNum that AssemblySeq 2 belonged to? var selectedAssembly = edvJobAsmbl.dataView.Table.Rows.Cast().FirstOrDefault(x => x.AssemblySeq==2); selectedAssembly["MyCustomField_c"] = "Also data!"; --- ## Post #5 by @josecgomez It wouldn't, that would just give you the first assembly in the table with seq 2 you can add && x.JobNum="my job" to your condition -Jose Gomez --- ## Post #6 by @DurangoBurke Thanks Jose! I seem to have some issue with the Cast portion on the following line? var selectedAssembly = edvJobAsmbl.dataView.Table.Rows.Cast().FirstOrDefault(x => x.AssemblySeq==2 && x.JobNum="00035356"); Error: CS1061 - line 277 (406) - 'System.Data.DataRowCollection' does not contain a definition for 'Cast' and no extension method 'Cast' accepting a first argument of type 'System.Data.DataRowCollection' could be found (are you missing a using directive or an assembly reference?) --- ## Post #7 by @Waffqle_De_LaCroix When you call the **Cast** method you need to tell it which type you are casting to. Like so: > `edvJobAsmbl.dataView.Table.Rows.Cast()` If you continue to receive that message you probably don't have Linq on that screen. You can import linq by adding a using statement: > `using System.Linq;` If you still receive an error about linq not being available, then the screen was likely built without access to linq. If you're on a version before 10.1.400.00 there are quite a few screens without it. There are ways to get around this but they're either hackier than I recommend or too complex for a quick solution. You need to fall back to a solution that doesn't involve linq. For instance, looping through the records and firing when you find the one you want. > foreach (DataRowView row in edvJobAsmbl.dataView) { > if (string.Equals((string)row["JobNum"], "SomeJob", StringComparison.OrdinalIgnoreCase) > && (int)row["AssemblySeq"] == 2 ) { > MessageBox.Show("We found the row we're looking for!"); > } > } --- **Canonical:** https://www.epiusers.help/t/looping-through-assemblies-in-a-dashboard/35553 **Original content:** https://www.epiusers.help/t/looping-through-assemblies-in-a-dashboard/35553