$$anonymous$$aybe I watched a video tutorial in YT and the autor post a link to get them from his github. IDbCommand Databasecommand = DatabaseConnection.CreateCommand() Ībout the plugins files, I don't remember how I got them. IDbConnection DatabaseConnection = new SqliteConnection(filepath) So, I import System.Data library on my script to work with connections and commands for database.Īdd "using System.Data " to import the library. In this new script you use SqliteConnection and SqliteCommand to work, but I remember that I got errors using this libraries directly to work. That was my fault when I posted my script. The errors can be appears because you don't use the System.Data library. String quer圜reateAd$$anonymous$$ = "INSERT INTO table_Gebruikers (voornaam, achternaam, wachtwoord) VALUES ('ad$$anonymous$$', 'ad$$anonymous$$Achternaam', 'ad$$anonymous$$') " ĭatabaseCommand.CommandText = quer圜reateAd$$anonymous$$ String sqlQuery = "CREATE TABLE IF NOT EXISTS (id INTEGER PRI$$anonymous$$ARY KEY AUTOINCRE$$anonymous$$ENT NOT NULL, voornaam VARCHAR(20) NOT NULL, andereNamen varchar(50), achternaam VARCHAR(20) NOT NULL, wachtwoord VARCHAR(255) NOT NULL) " var dbconn = new SqliteConnection(conn) ĭatabaseConnection = new SqliteConnection(filepath) ĭatabaseCommand = DatabaseConnection.CreateCommand() String filepath = "URI=file:" + Application.dataPath + DatabaseName
UNITY PC BUILD ON WEBSITE UPDATE
Start is called before the first frame update Private string DatabaseName = "/database/DatabaseLeerlingInfo.db"
Public class DatabaseController : $$anonymous$$onoBehaviour Here is my code: using System.Collections
UNITY PC BUILD ON WEBSITE ANDROID
How did you aquire those 4 files? Do the same files work for windows, android and IOS?ĮDIT 1: Like Katsamobus said, you need " using System.Data " but I only realised that when I actually wanted to use the "IDatareader" functions to get data from the database. I got a lot of error lines in visual studio 2019 so I changed it a little bit and now it works for me. Let me know if this post helped you to solve your issues :D Go to Build Settings and select x86_64 in Architecture field (Windows Platform).ĭo a new build and check if game run correctly. Net Standard 2.0 is selected in Api Compatibility Lebel field.
Go to Player Settings / Other Settings and be sure. " INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," + SqlQuery = "CREATE TABLE IF NOT EXISTS (" + Using (dbconn = new SqliteConnection(conn)) String filepath = Application.dataPath + DATABASE_NAME String DATABASE_NAME = "/mydatabase.s3db" Add the "IF NOT EXISTS" clause in every CREATE TABLE to prevent future Sql exceptions.Ĭall the new function from the Start() function after find the database. Into your database manager script, add a function that create the tables you need in your database. When you build your project, Unity exports the database EMPTY, that is, without tables.
UNITY PC BUILD ON WEBSITE FREE
The following files must be inside the Plugins folder:, , f and sqlite3.dll. Unity IAP (In App Purchases) lets you sell a variety of items directly within your free or paid game including premium content, virtual goods and subscriptions. You have two problems here: error in Unity Editor and issue in build.