Hi.
Trying to edit a database, but database doesn’t change, when starting the script.
Can somebody help to find an error?
Code:
-
string connectionString = “Data Source=file:Base123.db”;
-
IDbConnection dbcon;
-
dbcon = (IDbConnection)new SqliteConnection(connectionString);
-
dbcon.Open();
-
sql = "INSERT INTO TheTable (UserName, Min) VALUES ('" + UserName + "'," + transform.localScale.x + ")";
-
IDbCommand dbcmd = dbcon.CreateCommand();
-
dbcmd.CommandText = sql;
-
dbcmd.ExecuteNonQuery();
-
dbcmd.Dispose();
-
dbcmd = null;
-
dbcon.Close();
-
dbcon = null;
P. S. Getting this error on start:
MissingMethodException: Method not found: ‘System.Threading.Monitor.Enter’.
Mono.Data.Sqlite.SqliteStatementHandle.ReleaseHandle ()
System.Runtime.InteropServices.CriticalHandle.Dispose (Boolean disposing) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs:56)
System.Runtime.InteropServices.CriticalHandle.Dispose () (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs:42)
Mono.Data.Sqlite.SqliteStatement.Dispose ()
Mono.Data.Sqlite.SqliteCommand.ClearCommands ()
Mono.Data.Sqlite.SqliteCommand.set_CommandText (System.String value)
Mono.Data.Sqlite.SqliteConnection.Open ()
DataControls.Start () (at Assets/Scripts/DataControls.cs:22)