Hey there!

I’m trying to write a C# script that connects to a MySqlDatabase. I already tried several packages and tutorials but I get 1-6 errors everytime (System.IO.FileNotFoundException and/or BadImageFormateException). There were some libraries from here that I tried, too, but the provided download links to required DLLs were expired, so I got the same errors when trying to run it.

Maybe someone can provide me a working library and some install instructions?

Thanks in advance

Do you use .net 4.5.1? Also you need to pick the portable library to connect with.

shameless selfplug: you can always use exports from my mysql stuff

First of all: Thanks for responding =D

Using .net 4.5.1 is no problem, but how do I use this in C#? The documentation provides just Lua examples :confused:

if you extend something with BaseScript from the FiveM server thingy, you can use

Exports['ghmattimysql'].exportname('SQL', parameters)

Well, I already tried this, but I get this error everytime:

did you add a dependency in your resource lua to the resource containing the exports, so it definetly starts before yours?

Also i think you might want to use the callback async wrappers.

Yeah, moving to async Wrappers as soon as it works ^^. Just saw the synced one first.
So in the __resource.lua I wrote : dependencies{‘ghmattimysql’} (With paragraphs)

Or do I have to specify the exact file?

nope.

should work.

Well… that’s the same problem that I had before… it should work but it doesn’t :confused: