-1
我正在使用Xamarin和Visual Studio 2017構建一個跨平臺的應用程序。我與連接到我的數據庫有問題。所以每當我啓動我的應用程序時,它總是因爲連接到數據庫而崩潰。這是我連接到數據庫的代碼。SQLite連接GetConnection /錯誤
public SQLiteConnection GetConnection()
{
var filename = "database.db3";
var documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsPath, filename);
var connection = new SQLiteConnection (new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), "database.db3", true);
return connection;
}
任何建議,我怎麼能解決這個問題。
謝謝你的建議。
有什麼用,你做的前三行的第四行的? – Steve
我即將包含路徑變量而不是文件名。其實我只是做了,但它不起作用。 – Jovan
我認爲你應該嘗試捕捉由你的代碼引起的異常,並報告收到的確切錯誤消息。顯示的通用消息是在調試應用程序 – Steve