DataTable Select vs LINQ Select

后端 未结 3 2112
广开言路
广开言路 2020-12-30 09:29

Any advice on when DataTable.Select should be used versus LINQ Select when dealing with an in-memory DataTable?

I find LINQ syntax

3条回答
  •  难免孤独
    2020-12-30 10:01

    Without even mentioning LINQ, I would not use DataTable.Select anywhere unless I absolutely had to, since in most cases it means performing in the client something that should probably be performed in the database.

    Update: my answer here is probably a bit overstated. There are sometimes legitimate reasons for using a DataTable as a (hopefully) small in-memory database that minimizes client-to-database round trips.

提交回复
热议问题