M mason Client Регистрация 30.04.2017 Сообщения 46 Благодарностей 3 Баллы 8 20.11.2017 #1 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
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 130 Баллы 113 20.11.2017 #2 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
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);
M mason Client Регистрация 30.04.2017 Сообщения 46 Благодарностей 3 Баллы 8 20.11.2017 #3 @Dimionix Awesome. Thanks... I've been your snippet works like a champ and in under a second Реакции: Dimionix