How to delete all data in a table

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

zenrast

Client
Регистрация
20.03.2013
Сообщения
57
Реакции
1
Баллы
8
In "Lists" we have the option to choose "Delete lines"->"Remove all elements".

How to do the same for a Table ?
 
I also miss that. Along with deleting lines by value as you can do with lists. I've already suggested it but don't think the task is started yet.
 
project.Tables["table1"].Clear();
 
The .Clear() function didnt work for me on 5.3.0.0.

But i think the function bellow does the trick:

Код:
Развернуть Свернуть Копировать
IZennoTable myTable = project.Tables["myTable"];
lock(SyncObjects.TableSyncer)
{  
    for (int i=myTable.RowCount - 1; i >= 0; i--)
    {
     myTable.DeleteRow(i);
    }
}
 

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