Hello,
I am having a little issue trying to use SQLite in Unity 5.3. I have been following the SQLite setup provided here (Database (SQLite) Setup for Unity - Unity Answers) and I have tried to open a sqlite database with the following code:
void Start()
{
string conn = "URI=file:" + Application.dataPath
+ "/trajectoriesDB"; //Path to database.
IDbConnection dbconn;
dbconn = (IDbConnection) new SqliteConnection(conn);
dbconn.Open();
Debug.Log("Database open");
dbconn.Close();
dbconn = null;
}
The problem is that, when the program reaches the line dbconn.Open();, Unity throws the following exception:
InvalidOperationException: Cannot set CommandText while a DataReader is active
I tested in a very simple scene where only this script is running, and I have also double checked that I have all the .dll I need in Assets/Plugins and the database file in Assets/.
I cannot find the root of this problem, since I do not have any DataReader in my code. Has anyone experienced the same problem before?
Thank you in advance!