About "For Each <Data Column>"
-
I want to call a column name using each column of "For Each", but the following error message is detected and it cannot be executed.
Compiler error (s) encountered Processing expression "Dt_Test".
There is no implicit type conversion from 'System.Data.DataColumnCollection' to 'System.Collections.Generic.IEnumerable(Of System.Data.DataColumn)' in Option Strict On.Please tell me what to do.
Thank you very much. -
Many of the DataTable collections does not support IEnumerable so you need to cast them first, you can do that with Linq
dt.Columns.Cast(Of DataColumn)()
-
thank you for your answering.
I did as described, but sometimes I could and sometimes I couldn't. I would like you to check the Xaml file, is it possible?
Also, I can't upload Xaml files, so I would appreciate it if you could tell me how to share them. -
@nmatsuok just reply to this thread and drag the file in to the text boks. I have just enabled file upload, so should work now
-
@allan-zimmermann
Thank you for your support.
I have attached two XAML files, so please investigate. -
@nmatsuok Once you added a microsoft activity, it also imported the namespace for PIA and that also have a type datatable.
But you should remove the "new DataTable" part, that is what the "Create DataTable" activity is doing for you
-
@allan-zimmermann I forgot to answer your question. The solution for you is to not use assign and create a new table, "Create Table" activity will do that for you, but if you wanted to create the table your self, then in the "error" case, you need to use fully qualified name, so
New Data.DataTable
or
New System.Data.DataTable
-
@allan-zimmermann Thank you to you I confirmed that it work.
If I have any question, I’ll let you discuss.