Get a list of columns
I'm trying to get a list of columns from a table. Here is my code:
publicList<string> GetColumns(string serverName,string dataBaseName,string tableName)
{
List<string> columns =newList<string>();
Server server =newServer(serverName);
server.ConnectionContext.LoginSecure =true;
server.ConnectionContext.Connect();
Database dataBase =newDatabase(server, dataBaseName);
Table table =newTable(dataBase, tableName);
foreach (Column columnin table.Columns)
{
columns.Add(column.Name);
}
columns.Sort();
return columns;
}
The problem is that table.Columns.Count is 0. How do I get a list of columns in a table?

