DataTable to List<object>

后端 未结 7 987
误落风尘
误落风尘 2020-12-03 09:05

How do I take a DataTable and convert it to a List?

I\'ve included some code below in both C# and VB.NET, the issue with both of these is that we create a new object

7条回答
  •  囚心锁ツ
    2020-12-03 09:20

    Why not pass the DataTable into to the function instead of instantiating it? That would simply contain a reference.

    That's way too simple an answer too be worthwhile to you I'm sure, but I don't see how it doesn't solve your problem.

提交回复
热议问题