每当我打开时,帮助我的数据库加载(保存)数据 [英] help my database loads(save) data everytime when i open

查看:43
本文介绍了每当我打开时,帮助我的数据库加载(保存)数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MainPage()构造函数上有我的数据库实例让我感到困惑的是,当我告诉数据库不存在时,使用此代码创建它。

I have my database instance on the MainPage() constructor what makes me confuse is when I tell that if database doesn't exist create it using this code.

if(!db.DatabaseExist())

if(!db.DatabaseExist())

{

 。  db.CreateDatabse();

 .  db.CreateDatabse();

}

那个 导致我的应用程序在第二次启动时崩溃的内容

that cause what my app crashes what in second launch

推荐答案

1)崩溃时的异常是什么?

1) What is the exception when it crashes?

2)如果从构造函数移动到OnNavigatedTo方法,它是否仍会崩溃?

2) If you move from the constructor into the OnNavigatedTo method, does it still crash?


这篇关于每当我打开时,帮助我的数据库加载(保存)数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆