Standalone app + mysql + javascript ?

Hello,

I’m trying to use mysql in a standalone app.

I’ve find Mysql.Data.dll, and System.Data.dll but i don’t see how to use it in javascript. (I’ve test some demo but there doesn’t works…)

So i’m looking for good demo or tips (in javascript if it’s ok)

thanks

You use them the same way as in C#, only that using XXXX becomes import XXXX at the start of the file

That i’m trying … but i’ve an error.

I’ve download mysql.data.dll from http://dev.mysql.com/downloads/connector/net/1.0.html#downloads (platform : .NET/Mono, version 6.2.4).

I import mysql.data.dll in my project, I create a new javascript, I write :

And i’ve this error : Assets/DemoSQL.js(1,8): BCE0021: Namespace ‘mysql.data’ not found, maybe you forgot to add an assembly reference?

did you forget to drop the assembly into your project (optimally plugins folder)? :slight_smile:

just having it on the system is not enough

The dll is in Assets/Plugins folder on my project yes.

and the assembly contains that namespace?

normally they don’t do so, instead they provide the functionality required by System.Data.MysqlClient and alike

how can I find this info ?

By this demo (Redirecting…), I write this code

The error is more interesting : Assets/main.js(3,8): BCE0167: Namespace ‘Mysql.Data.MySqlClient’ not found in assembly ‘MySql.Data, Version=6.2.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d’

That mean Unity find MySql.Data I suppose ?

it means indeed that it found the assembly in generaly but not the specific namespace

perhaps the dll and documentation you found don’t base on the same version or alike, can’t comment on that.

…I’ve tested 6.2.4 and 6.3.6 version of .DLL but the error still the same.

Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type ‘System.Runtime.Versioning.TargetFrameworkAttribute’ from assembly ‘MySql.Data’.

at (wrapper managed-to-native) System.Reflection.Assembly:InternalGetType (System.Reflection.Module,string,bool,bool)

at System.Reflection.Assembly.GetType (System.String name, Boolean throwOnError, Boolean ignoreCase) [0x00000] in :0

at System.Reflection.Assembly.GetType (System.String name) [0x00000] in :0

at Mono.CSharp.RootNamespace.GetTypeInAssembly (System.Reflection.Assembly assembly, System.String name) [0x00000] in :0

at Mono.CSharp.RootNamespace.LookupTypeReflection (Mono.CSharp.CompilerContext ctx, System.String name, Location loc, Boolean must_be_unique) [0x00000] in :0

This error is unresolved, with mysql

id and password entrance with C # I made him a ride, but this error.