TableName RRS feed

  • Question

  • User-1735691636 posted

    How do I get the real tablename?

    (Not Table.DataContextPropertyName or entityType.Name)


    Monday, December 22, 2008 8:07 AM


  • User-330204900 posted

    Hi give this a try: 

    var realTable = table.Attributes.OfType<SYSTEM.DATA.LINQ.MAPPING.TABLEATTRIBUTE>().FirstOrDefault().Name;

    This should get you the name of the table like "dbo.Categories"

    abd the VB is: 

    Dim realTable = table.Attributes. _
    OfType(Of System.Data.Linq.Mapping.TableAttribute). _
    Hope this helps [:D]
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 22, 2008 9:50 AM