How to initialize a DataColumnCollection variable?

License type(Free, Trial/License code):

Community Edition

Studio/Robot version:

2019.6.0

Screenshot:

image

I have tried to initialize a DataColumnCollection in many ways including this one. I can do it when I call the DataTable.Columns method on a prepopulated DataTable and assign it to this DataColumnCollection variable but I want to be able to initialize a blank collection so I can add DataColumns to the collecitons based on dynamic size. Let me know if there’s anyway I can do this.

Thanks

Hope there is no way to initialize the datacolumncollection, instead you can assign the values as

dtcolcollection = table.columns
directly…
Reference ;
https://www.codeproject.com/Forums/12076/ASP-NET.aspx?df=90&mpp=25&sort=Position&spc=Relaxed&select=2550428&tid=2550428

2 Likes

Instead for your case you may want to use simply use an array or list of datacolumns

1 Like

Thanks all, I will just use an array

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.