creating alias for functionname

Hi,

Is it possible to create an alias for object.function

I have this code

DSMarketDisplay.Tables[sTableName].Rows[hti.Row]["date1"] = oArgs.Date1;

DSMarketDisplay.Tables[sTableName].Rows[hti.Row]["CMonth"] = oArgs.CMonth;

and the list goes on, what I dont want to do here is repeat this

DSMarketDisplay.Tables[sTableName]

in all lines. Can I just create an alias or something to remove the redundancy

Thanks,



Answer this question

creating alias for functionname

  • MuraliMD

    bilalso wrote:
    but it happens in other cases as well when you have classes with long names or when you are using 3rd party tool.

    I don't see why any of those cause a problem. "long name" You only have to type it once.

    bilalso wrote:
    I was just wondering if there is any way of creating an alias in conditions like those.

    No, there's no alias functionality.



  • joeycalisay

    yeah... I know about that...but it happens in other cases as well when you have classes with long names or when you are using 3rd party tool. I was just wondering if there is any way of creating an alias in conditions like those.
  • renzo_xp

    How about

    DataTable t = DSMarketDisplay.Tables[sTableName];

    t.Rows[hti.Row]["date1"] = oArgs.Date1;

    t.Rows[hti.Row]["CMonth"] = oArgs.CMonth;



  • creating alias for functionname