C# Convert Object to list<string> -


i trying store dates first row list string. how convert them list string object?

public list<string> populatedates(string id) {     list<string> dates = new list<string>();     (int = 1; < table.columns.count; i++)     {         object o = table.rows[1][i];         console.writeline(o);     }      return dates; } 

you need add items list. can call tostring convert item string. example:

public list<string> populatedates(string id) {     list<string> dates = new list<string>();      (int = 1; < table.columns.count; i++)     {         dates.add(table.rows[1][i].tostring());     }      return dates; } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -