views:

694

answers:

2

I can use " Microsoft.SqlServer.Management.Smo.Table " in C# to get a table columns of a Sql Server 2005 database.

I have got the column.Name, but how can I get the column's Description in C#?

I have saw the link: http://stackoverflow.com/questions/887370/sql-server-extract-table-meta-data-description-fields-and-their-data-types

But how can I use C# "Microsoft.SqlServer.Management.Smo" dll to get a column's Description?

A: 

Why don't you use the result from the query described in the link you gave?

crauscher
I have saw the link. But how can I just get a specific column's description in C# ? For example, I want to get the column "ProductId" 's description in the "Product" table of "Northwind" Database.
Mike108
+3  A: 

Say your Smo.Table object is named t.

This will get the description:

t.Columns["ProductID"].ExtendedProperties["MS_Description"].Value
khutch
Thank you very much. It works!
Mike108