none
How do you read a field description from a sql datatbase using LINQ RRS feed

  • Question

  • Hello

    I need to read the description of some fields in a database.

    Is it possible to do that in LINQ AND IF YES HOW DO YOU DO THAT?
    Tuesday, January 13, 2009 6:29 AM

All replies

  • The really isn't an easy way to do it with LINQ. The Description property is stored as an extended property. You can use the fn_listextendedproperty function to retrieve the value of an extended property. Here is an example:

    SELECT name, value FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', 'Table1', 'column', default);

    Look up fn_listextendedproperty in BOL for more details.
    Sunday, January 18, 2009 1:58 AM