Hi...well I don't understand what mean this error. and im really new to C#... Code (csharp): VerificationException: Error verifying Mono.Data.Sqlite.SqliteConvert:UTF8ToString (intptr): Incompatible parameter value with constructor signature: sbyte* X void* (Native Pointer) at 0x0032 Mono.Data.Sqlite.SqliteConvert.ToString (IntPtr nativestring) Mono.Data.Sqlite.Sqlite3.SqliteLastError () Mono.Data.Sqlite.Sqlite3.Prepare (System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, System.String strRemain) Mono.Data.Sqlite.SqliteCommand.BuildNextCommand () Code (csharp): using UnityEngine; using Mono.Data.Sqlite; using System; using System.Data; using System.Collections; using System.Collections.Generic; public class SQLiteServer : MonoBehaviour { private static IDbConnection dbcmd; // Use this for initialization void Start () { string id = "1"; string connectionString = "URI=file:/Users/[User]/test.db"; IDbConnection conn = new SqliteConnection(connectionString); conn.Open(); print("Connection: " + conn.State); IDbCommand dbcmd = conn.CreateCommand(); dbcmd.CommandText = "SELECT * FROM TestTable WHERE id=" + id; IDataReader reader = dbcmd.ExecuteReader(); while(reader.Read()) { id = reader["id"].ToString(); string CreatedDate = reader["CreatedDate"].ToString(); string Active = reader["Active"].ToString(); string Name = reader["Name"].ToString(); print(id + " " + CreatedDate + " " + Active + " " + Name); } reader.Close(); reader.Dispose(); conn.Close(); conn.Dispose(); } }
I don't know about the error, but have you tried using "reader.GetString()" instead of "ToString()"? Jeff
Yep..still same error... i tried put "print ("ENTER");" before the line "string connectionString = "URI=file:/Users/[User]/test.db";" it has show up in console then next doesnt show up "Connection: Open" from the code: Print("Connection: " + conn.State);... I wonder something wrong with connection string...
I found the problem... it was DLL not compatible or broken DLL.. so i found other DLL was working and can connect and even also works with export... Thanks Jgodfrey and Andorov ^_^