LINQ: Get Table Column Names

后端 未结 11 624
-上瘾入骨i
-上瘾入骨i 2020-12-31 01:14

Using LINQ, how can I get the column names of a table? C# 3.0, 3.5 framework

11条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-31 01:50

    The below code will worked from returns all the column names of the table

    var columnnames = from t in typeof(table_name).GetProperties() select t.Name
    

提交回复
热议问题