开始将 sqllite db 与 zumero 同步时遇到问题(使用 xamarin.ios)。我已经设置了我的同步命令:
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 ()
我已经用这个设置了dbName:
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();
希望有人能看到我做错了什么?谢谢。