0

Trying to use .accdb (via this snippet) in Unity 2018.2.2+ (upgraded to .10f1 just now, but same issues still occurring).

The type or namespace name Odbc' does not exist in the namespace System.Data'. Are you missing an assembly reference?

The type System.Data.DataTable' has been forwarded to an assembly that is not referenced. Consider adding a reference to assembly System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Where does one find the missing .dll's for System.Data, System.Data.odbc, System.Data.DataTable etc on Mac?

Note: have tried the other results at Reference System.Data in Visual Studio 2015 UNITY project and others. The new directory for mono no longer seems to contain those .dll's? /Applications/Unity/Unity.app/Contents/Frameworks/MonoBleedingEdge/MonoEmbedRuntime/osx seems to only have 3 .dylibs https://gyazo.com/d7222ee65635db6394be000605739759

ina
  • 19,167
  • 39
  • 122
  • 201

1 Answers1

0

This directory seems to be changing over time. It's currently the XXX.MonoBleedingEdge/lib/mono folder. You can find the System.Data.dll in these directories:

On Mac:

/Applications/Unity/Unity.app/Contents/Frameworks/MonoBleedingEdge/lib/mono/2.0

On Windows:

<UnityInstallationDirectory>\Editor\Data\MonoBleedingEdge\lib\mono\2.0-api

There should be different .NET dll version folders in the /Applications/Unity/Unity.app/Contents/Frameworks/MonoBleedingEdge/lib/mono or <UnityInstallationDirectory>\Editor\Data\MonoBleedingEdge\lib\mono but the 2.0 or 2.0-api folder seems to be fine if you are using the ".NET 3.5" in the Editor. If you are using anything above it, make sure to use the correct folder (Usually the 4.5 folder for ".NET 4.x" option in the Editor).

Remember to put them in the <ProjectName>\Assets\Plugins folder.

Programmer
  • 121,791
  • 22
  • 236
  • 328
  • For 2018.2.2f1 and .10f1 - that folder only contains 3 dylib's ... https://gyazo.com/d7222ee65635db6394be000605739759 ... i don't see System.Data.dll - or am i just not understanding how to use these dylib's as dll's? https://gyazo.com/85c28bf9255e27f7a74aaf5d6d76214a – ina Oct 02 '18 at 21:28
  • That's weird. There should be a folder named "lib" under "MonoBleedingEdge". Run the installer again then download "Mac Build Support (Mono)" – Programmer Oct 02 '18 at 22:30
  • Seems to have moved out of Frameworks folder - just under `../Contents/Mono/lib/mono/`... – ina Oct 02 '18 at 23:28
  • Ok. If you find the folder, just copy the `System.Data.dll` from there – Programmer Oct 02 '18 at 23:45
  • Next error: `System.DllNotFoundException: Dependency unixODBC with minimum version 2.3.1 is required.` ... ugh – ina Oct 02 '18 at 23:54
  • And... System.Data.Odbc isn't in that directory – ina Oct 02 '18 at 23:55
  • You wan want to use `System.Data.SQLClient` over `System.Data.Odbc` as that's what is supported in Unity. – Programmer Oct 03 '18 at 00:06
  • That then yields this error: `error CS0234: The type or namespace name `SQLClient' does not exist in the namespace `System.Data'. Are you missing an assembly reference?` – ina Oct 03 '18 at 00:16
  • Also, I am trying to access the .accdb which requires ODBC... though i could convert that somehow to sql*? https://stackoverflow.com/questions/7764707/sql-connection-string-for-microsoft-access-2010-accdb – ina Oct 03 '18 at 00:19
  • For your SQLClient error, you also need `System.Data.SqlClient.dll`. As for .accdb, that's for Microsoft Windows specific stuff and Unity did not include that. The fact that you're trying to use it on a Mac will make it more complicated than ever. What are the names of folders in the `Mono/lib/mono` folder? Can you show a screenshot? Also, where did you get the current `System.Data.dll` you're using? – Programmer Oct 03 '18 at 00:33
  • https://gyazo.com/f15733a108c36a14850cbdd9289f4b9a Grabbed the System.Data.* files here – ina Oct 03 '18 at 00:35
  • Which db conversion would you recommend for Unity iOS apps – ina Oct 03 '18 at 00:37
  • I don't even know what you're doing to begin with and can't recommend. What are you doing? You need to store data on a remove/network server or you just need to do it locally on the device? – Programmer Oct 03 '18 at 00:44
  • Just read/query data locally from a large USDA Nutritions database - they provide the entire thing as an .accdb https://ndb.nal.usda.gov/ndb/nutrients/index – ina Oct 03 '18 at 00:45
  • The screenshot you posted is what's in `Mono/lib/mono` folder? – Programmer Oct 03 '18 at 00:57
  • yes, the screenshot directory is on the bottom part of he screenshot https://gyazo.com/c3e41c15dd3dddd109888b7a20c84fe6 – ina Oct 03 '18 at 04:16