I have a utility method from which I need to return set of strings which could binded to a list control in the UI. I am in doubt whether to go with array of strings which I think is the lighter than a datatable Or add them into datatable so that I can directly bind the datatable to list control? Which one is bettter in performance?
Thanks in advance.
Speaking of performance I think that use an array of string is faster, but you should choose one of them as needed and this depends on how do you want to manage this set of data, because if your goal is just to bind them to a list control I recommend you use a simple array of strings, else if you need something more specific like if you’re dealing with a set of data from a database you should use a DataTable because it allows you to set a PrimaryKey create relations with others DataTables and other things. So for more info on the DataTable look here.