1

I need to use AsEnumerable() on a DataTable in Unity, but it seems the Unity version of System.Data doesn't have that method!

enter image description here

I tried to import the VS version of dll into the asset, but it told me that Multiple assemblies with equivalent identity have been imported.

Could somebody please be so kind and teach me what should I do!?

Much appreciated!

PiggyChu001
  • 440
  • 6
  • 20

1 Answers1

1

The method AsEnumerable() is an extension fo the class Datatable, you need to add the System.Data.DataSetExtensions.dll into your assets.

DomCR
  • 533
  • 4
  • 19
  • It told me `Loading assembly failed: "Assets/Plugins/System.Data.DataSetExtensions.dll"`. What should I do!? – PiggyChu001 Oct 16 '19 at 13:14
  • I'm using 2018.4.5f1. – PiggyChu001 Oct 16 '19 at 13:49
  • Are you using unity hub? you can try to install a newer version and update your project easily, with my version it works – DomCR Oct 16 '19 at 13:52
  • I'm sorry! I imported the "wrong" dll! I imported the VS version of DataSetExtensions.dll! Once I changed it to unity version from Unity\Editor\Data\Mono\lib\mono\2.0, it worked like a charm! Thanks! :) – PiggyChu001 Oct 16 '19 at 14:18