如何使用C#获取Sql Server 2005的列说明? [英] How to use C# to get column's description of Sql Server 2005?
本文介绍了如何使用C#获取Sql Server 2005的列说明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在C#中使用 Microsoft.SqlServer.Management.Smo.Table来获取Sql Server 2005数据库的表列。
I can use " Microsoft.SqlServer.Management.Smo.Table " in C# to get a table columns of a Sql Server 2005 database.
我有column.Name,但是如何在C#中获取列的说明?
I have got the column.Name, but how can I get the column's Description in C#?
I已看到以下链接: SQL Server:提取表元数据(描述,字段及其数据类型)
I have saw the link: SQL Server: Extract Table Meta-Data (description, fields and their data types)
但是我该如何使用C# Microsoft.SqlServer.Management.Smo dll来获得列的描述?
But how can I use C# "Microsoft.SqlServer.Management.Smo" dll to get a column's Description?
推荐答案
假设您的Smo.Table对象名为t。
Say your Smo.Table object is named t.
这将获得描述:
t.Columns["ProductID"].ExtendedProperties["MS_Description"].Value
这篇关于如何使用C#获取Sql Server 2005的列说明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文