Select column based on variable in LINQ to SQL

前端 未结 5 1567
眼角桃花
眼角桃花 2021-01-19 03:43

I\'m using LINQ to SQL in C# in my application. I need to be able to select a column of a row, depending upon a variable. This is easy for the row as it\'s a simple where cl

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-19 04:44

    I don't think this is either possible or a good practice. Note that if the variable name is provided by user he or she can easily take all the data they want. Maybe you should try using enumeration and switch() clause?

提交回复
热议问题