anant,
you can find lot of samples in \Map ObjectARX SDK 2009\Map Samples\DotNet\ObjectDataCS
I am giving some code which worked for me for Map3D 2007. try this.
[CommandMethod("OdShow")]
public void ShowData()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
PromptEntityOptions pe = new PromptEntityOptions("Select Entity..: ");
PromptEntityResult pr = ed.GetEntity(pe);
if (pr.Status == PromptStatus.OK)
{
Autodesk.AutoCAD.ApplicationServices.TransactionManager tm = Application.DocumentManager.MdiActiveDocument.TransactionManager;
Transaction tr = tm.StartTransaction();
Entity en = (Entity)tm.GetObject(pr.ObjectId, OpenMode.ForRead);
MapApplication mapApp = HostMapApplicationServices.Application;
Tables tables = mapApp.ActiveProject.ODTables;
Records recs = tables.GetObjectRecords(0, en.ObjectId, Autodesk.Gis.Map.Constants.OpenMode.OpenForRead,true);
ed.WriteMessage("\n");
foreach (Record rec in recs)
{
Autodesk.Gis.Map.ObjectData.Table tbl = tables[rec.TableName.ToString()];
FieldDefinitions fldDef = tbl.FieldDefinitions;
ed.WriteMessage("\n");
ed.WriteMessage(rec.TableName.ToString());
ed.WriteMessage("\n");
ed.WriteMessage("--------------------");
ed.WriteMessage("\n");
for (int i = 0; i < fldDef.Count; i++)
{
ed.WriteMessage(fldDef.Name.ToString() + " : " + getValasStrig(rec));
ed.WriteMessage("\n");
}
ed.WriteMessage("\n");
}
}
}
Sreekar Masani.