I figured it out. I pasting my code if anybody is interested.
private ITable SetNonSpatialTable(string tableName)
{
try
{
//get map server
IMapServer3 mapServer = (IMapServer3)serverObjectHelper.ServerObject;
//get default map name
string mapName = mapServer.DefaultMapName;
//get map server info
IMapServerInfo3 pMapSrverInfo = mapServer.GetServerInfo(mapName) as IMapServerInfo3;
//get standalone table info collection
IStandaloneTableInfos pStandaloneTblInfos = pMapSrverInfo.StandaloneTableInfos;
int? tableID = null;
//get the ID of the desired table
for (int i = 0; i < pStandaloneTblInfos.Count; i++)
{
IStandaloneTableInfo pStandaloneTblInfo = pStandaloneTblInfos.get_Element(i);
//if the name matches, then set table ID
if (pStandaloneTblInfo.Name.ToUpper() == tableName.ToUpper())
{
tableID = pStandaloneTblInfo.ID;
}
}
//get map server object
IMapServerObjects3 pMapServerObj = serverObjectHelper.ServerObject as IMapServerObjects3;
if (tableID != null)
{
ITable pTable = pMapServerObj.get_StandaloneTable(mapName, Convert.ToInt16(tableID));
return pTable;
}
return null;
}
catch (Exception ex)
{
string errMsg = "An Error occured in the SOE method - SetNonSpatialTable - " + " " + "Error : " + ex.Message
+ "Stack Trace : " + " " + ex.StackTrace;
logger.LogMessage(ServerLogger.msgType.error, "SetNonSpatialTable", 400, errMsg);
return null;
}
}