Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8177865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:37:42+00:00 2026-06-06T23:37:42+00:00

I have a view called PersonOverview which has a bunch of columns; it’s a

  • 0

I have a view called PersonOverview which has a bunch of columns; it’s a totally normal view, nothing special about it.

I added an extended property called FlexGridHide with a value of 1 to the DatenbereichCD column of that view using.

EXEC sys.sp_addextendedproperty 
        @name = N'FlexGridHide', 
        @value = N'1', 
        @level0type = N'SCHEMA', @level0name = dbo, 
        @level1type = N'VIEW',  @level1name = vPersonOverview,
        @level2type = N'COLUMN', @level2name = DatenbereichCD;

I can find that extended property in SQL Server – no problem – it’s there.

But when I load data from the view into a DataTable, I’m obviously not able to actually read out that extended property:

string sqlSelect = @"SELECT TOP 5 DatenbereichCD FROM dbo.vPersonOverview";

DataTable personUebersicht = new DataTable();

using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDB"].ConnectionString))
using (SqlCommand cmd = new SqlCommand(sqlSelect, con))
using (SqlDataAdapter dap = new SqlDataAdapter(cmd))
{
   dap.Fill(personUebersicht);
}

DataColumn datenbereichCD = personUebersicht.Columns["DatenbereichCD"];    
int extendedProps = datenbereichCD.ExtendedProperties.Count;

The connection works just fine, the query gets executed just fine, returns five rows as expected, the column is present, and everything seems fine – except I don’t get any values in the ExtendedProperties collection – the .Count is always 0.

Any ideas? Is there anything I can do to actually get those extended properties? Connection string parameter or a property on the SqlCommand or something obscure?

Update: to the untrained ignorant, having Extended Properties on SQL Server columns, and Extended Properties on the ADO.NET DataColumn type sort of suggested that those SQL Server extended properties would be loaded into the ADO.NET extended properties – but that really doesn’t seem to be the case – ah well…..

I ended up using a second query, as Kevin suggested – but since I need to get extended properties for both tables and views and you have to specify what you’re looking for using the fn_listextendedproperty function, I instead chose to query the sys.extended_properties system catalog view for the information I need. This here is my query that I’m using to get the information I need about the extended properties from SQL Server:

SELECT 
    ep.class, ep.class_desc, ep.name, ep.value,
    SchemaName = s.name,
    ObjectName = o.name,
    ColumnName = c.Name,
    ObjectType = o.type, 
    ObjectTypeDesc = o.type_desc
FROM sys.extended_properties ep
INNER JOIN sys.objects o ON ep.major_id = o.object_id
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
INNER JOIN sys.columns c ON ep.major_id = c.object_id AND ep.minor_id = c.column_id
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T23:37:44+00:00Added an answer on June 6, 2026 at 11:37 pm

    According to this post the SQL Server extended properties and the ADO.NET extended properties are not related:

    The dataColumn.ExtendedProperties is not related to the extended property of column on the SQL server backend.

    It appears that you will need to resort to retrieving the extended properties in a separate query.

    DataTable personUebersicht = new DataTable();
    DataTable extendedProperties = new DataTable();
    
    using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MYDB"].ConnectionString))
    {
        string sqlSelect = @"SELECT TOP 5 DatenbereichCD FROM dbo.vPersonOverview";
        using (SqlCommand cmd = new SqlCommand(sqlSelect, con))
        using (SqlDataAdapter dap = new SqlDataAdapter(cmd))
        {
            dap.Fill(personUebersicht);
        }
    
        string sqlProperties = @"SELECT name, value FROM ::fn_listextendedproperty(null,'user','dbo','view','vPersonOverview','column','DatenbereichCD')";
        using (SqlCommand cmd = new SqlCommand(sqlProperties, con))
        using (SqlDataAdapter dap = new SqlDataAdapter(cmd))
        {
            dap.Fill(extendedProperties);
        }
    }
    
    // Test the results
    foreach (DataRow row in extendedProperties.Rows)
    {
        Console.WriteLine(string.Format("{0}: {1}", row["name"], row["value"]));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view called, clients which shows a list of calls from the
Ok, so here's the situation. I currently have a view controller called MainViewController which
I have a view and template called index.html. I have a image which is
I am new to iPhone development. I have a view called barView which is
If I have one view which called myview1.py and I want to call a
I have a view called Forms that I am displaying and it has a
Let's say you have a view called View Story which is just a web
I have a view class called App.BlockView . It has a property called selected
I have a page (view) called test. It has 3 links with a variable?vars='some_number'
I have a view controller called vc0 which is presented like this: [self presentViewController:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.