Hello All,
I want to get the datatable using the table name and modify the table
to add additional columns(Field definitions) but i am not able to do it.
here is what i have tried please assist...
=======================================================
public static void add_fld(string tables_name, string c)
{
Tables tables = HostMapApplicationServices.Application.ActiveProject.ODTables;
Autodesk.Gis.Map.ObjectData.Table table = tables[tables_name];
MapApplication app = HostMapApplicationServices.Application;
if (!IsTableExisted(tables, tables_name))
{
Global.variables.ed.WriteMessage("\n The table doesn't exist.");
return;
}
Global.variables.ed.WriteMessage("\n The table exist.");
FieldDefinitions tabDefs = table.FieldDefinitions;
FieldDefinition def4 = FieldDefinition.Create("FIRST_FIELD", "String Type", "A");
tabDefs.AddColumn(def4, 4);
//table.FieldDefinitions.AddColumn(def1, 4);
tables.UpdateTable(table.Name, tabDefs);
}
Regards,
Raghulan Gowthaman Cert IV TAA, B.E,.
Senior Technical Consultant | Developer - R&D
A2K Technologies Sydney
Web : www.a2ktechnologies.com.au
www.civil3dforum.com | www.e4forums.com
www.zcodia.com.au
www.raghulangowthaman.com