How to get a list out of a table

  • Автор темы Автор темы mason
  • Дата начала Дата начала

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
 
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
@Dimionix
Awesome. Thanks... I've been :dy:

your snippet works like a champ and in under a second
 
  • Оценить
Реакции: Dimionix

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