Hello. I'm using Unity 5.0.1f1 (64-bit) for windows and i've been trying to connect to DB so i should use packae System.Data. But when i'm typeing using System.Data; i'm getting an error :
Error CS0234: The type or namespace name 'Data' does not exist in the namespace 'System' (are you missing an assembly reference?) (CS0234) (Assembly-CSharp)
So it's seems to me that my unity doesn't have package System.Data. The question is : Where i can get it and how i can install it?
Answer by tebandesade
May 13, 2015 at 04:35 PM
Hi you have to add the .dll file of System.Data to your Assets\Plugins folder . To do so, go to your directory Unity\Editor\Data\Mono\lib\mono\2.0 and get the System.Data file and later add it to the folder mention before.
Answer by Jessespike
May 13, 2015 at 04:41 PM
If you have .NET installed already, you can copy the dll from there and paste into your project "Assets\Plugins".
Depending on which version you want, you can find the dll
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework
C:\Program Files (x86)\Unity\Editor\Data\MonoBleedingEdge\lib\mono\2.0
If not, or still having trouble locating it. Do a search for "System.Data.dll" from C:\
Answer by BenReese
Jun 15, 2016 at 06:21 AM
Hi, I have followed the instructions here (and in various other posts) and it all seems to make sense. I have no issues at compile time or in Unity itself except that when I try to run the project I get a nice big message saying that "All compiler errors must be fixed before you can enter play mode". Well There are no compiler errors!
I have take System.Data.dll from C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\2.0
The error seems to manifest as soon as I try to instantiate a SqlConnection object. I can create a variable reference to it no problem, but cannot instantiate it.
I can however create objects in System.Data.SqlClient no problem.
Any More ideas please
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
How can I connect Unity to an SQL database in order to implement an MMO?
parameter error in microsoft SQL connection with unity3d
Players can decompile my game and find out the login and password to my sql server.... WHAT DO I DO??
Windows Phone and System.Data.SQL/Mono.Data.SQLite
How to connect a mobile app to an online database?