How to get a list out of a table

mason

Client
Регистрация
30.04.2017
Сообщения
46
Благодарностей
3
Баллы
8
I need to get column "B" out of a table.

I am pulling 1 line at a time and putting to var but is there a way to do this with C#? ...

need all the lines from B

Thanks
 

Dimionix

Moderator
Регистрация
09.04.2011
Сообщения
3 068
Благодарностей
3 100
Баллы
113
To list
C#:
IZennoTable table = project.Tables["Table"];
IZennoList list = project.Lists["List"];
string column = "B";

for (int i = 0; i < table.RowCount; i++)
    list.Add(table.GetCell(column, i));
To variable
C#:
IZennoTable table = project.Tables["Table"];
string column = "B";

List<string> tmpList = new List<string>();
for (int i = 0; i < table.RowCount; i++)
    tmpList.Add(table.GetCell(column, i));
return string.Join("\r\n", tmpList);
 
  • Спасибо
Реакции: Grapidly и proffman

mason

Client
Регистрация
30.04.2017
Сообщения
46
Благодарностей
3
Баллы
8
@Dimionix
Awesome. Thanks... I've been :dy:

your snippet works like a champ and in under a second
 
  • Спасибо
Реакции: Dimionix

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)