解决sqllite db与zumero同步问题(使用xamarin.ios)时出现问题。我安装我的sync命令:调用zumero_sync时出现异常
cmd.CommandText =
@"SELECT zumero_sync(
'main',
@server_url,
@dbfile,
zumero_internal_auth_scheme('zumero_users_admin'),
@credentials_username,
@credentials_password,
@temp_path
);";
cmd.Parameters.AddWithValue ("@server_url", "https://zinst*****.s.zumero.net");
cmd.Parameters.AddWithValue ("@dbfile", dbPath);
cmd.Parameters.AddWithValue ("@credentials_username", "myusername");
cmd.Parameters.AddWithValue ("@credentials_password", "*mypassword*");
cmd.Parameters.AddWithValue ("@temp_path", System.IO.Path.GetTempPath());
,但我得到一个例外:
Unhandled managed exception: Object reference not set to an instance of an object (System.NullReferenceException)
at System.Data.SQLite.SQLiteConnection.GetPointer() [0x00000] in <filename unknown>:0
at System.Data.SQLite.SQLiteConnection.ZumeroRegister() [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Data.SQLite.SQLiteConnection:ZumeroRegister()
我已经设置了数据库名与此:
string personalFolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
string dbName = "***.db";
string dbPath = Path.Combine (personalFolder, dbName);
var conn = new SQLiteConnection ("Data Source=" + dbPath);
conn.Open();
conn.ZumeroRegister();
希望有人能看到我在做什么不正确?谢谢。
我们可以看到实际打开/注册SQLiteConnection的代码吗? –
确定的事情:var conn = new SQLiteConnection(“Data Source =”+ dbPath); \t \t \t conn.Open(); \t \t \t conn.ZumeroRegister(); – user2420225