using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnitySampleAssets.CrossPlatformInput;
using Mono.Data.Sqlite;
using System.Data;
using System;
public class ShopScript : MonoBehaviour {
public Text txtDamage;
public Text txtAcc;
public Text txtCurrent;
public Text txtMax;
public Text txtDamageUp;
public Text txtAccUp;
public Text txtCurrentUp;
public Text txtMaxUp;
public Sprite img;
private String[] WName;
private String[] WDamage;
private int counter;
private IDbConnection dbconn;
void Start () {
counter = 0;
string connection = "URI=file:" + Application.persistentDataPath + "/MYGAMEDB.s3db";
dbconn = (IDbConnection) new SqliteConnection(connection);
dbconn.Open(); //Open connection to the database.
IDbCommand dbcmd = dbconn.CreateCommand();
string sqlQuery = "SELECT * FROM WeaponShop";
dbcmd.CommandText = sqlQuery;
IDataReader reader = dbcmd.ExecuteReader();
while (reader.Read())
{
//WDamage[counter] = reader.GetString(2);
}
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbconn.Close();
dbconn = null;
}
}
and this Error happen. how to fix it ?
EntryPointNotFoundException: sqlite3_next_stmt
Mono.Data.Sqlite.SQLiteBase.ResetConnection (Mono.Data.Sqlite.SqliteConnectionHandle db)
Mono.Data.Sqlite.SQLiteBase.CloseConnection (Mono.Data.Sqlite.SqliteConnectionHandle db)
Mono.Data.Sqlite.SqliteConnectionHandle.ReleaseHandle ()
System.Runtime.InteropServices.CriticalHandle.Dispose (Boolean disposing) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs:56)
System.Runtime.InteropServices.CriticalHandle.Dispose () (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Runtime.InteropServices/CriticalHandle.cs:42)
Mono.Data.Sqlite.SQLite3.Close ()
Mono.Data.Sqlite.SqliteConnection.Close ()
(wrapper remoting-invoke-with-check) Mono.Data.Sqlite.SqliteConnection:Close ()
Mono.Data.Sqlite.SqliteConnection.Open ()
ShopScript.Start () (at Assets/ShopScript.cs:37)