开发者

How to get field name from a SQL statement using c#

I want to retrieve field n开发者_JS百科ames from a SQL statement. For example, if I have:-

SELECT a, tbl.b, [tbl.s] 
FROM tbl

I'd like to retrieve::

  • a
  • tbl.b
  • [tbl.s]

I'd need to do it via any database object.


Using the SqlDataReader Class you can do:

Reader.GetName(columnNumber)

and that will return the column name.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜