Xamarin的Andr​​oid C#的SQLite [英] Xamarin Android C# SQLite

查看:132
本文介绍了Xamarin的Andr​​oid C#的SQLite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的Andr​​oid。



我在C#Visual Studio和编码使用Xamarin。



我见过创建一个数据库,如果它不存在的样品,但不是我要找的。

有没有人有任何代码(C#)使用已在Assets文件夹中现有的SQLite数据库,而不是Android设备上创建新的数据库?


解决方案

您必须复制数据库文件从资产文件夹复制到设备上的某个地方,然后用在您的应用程序。请注意,您只需要操作一次,当你的应用程序首先启动。


I'm new to Android.

I am using Xamarin on Visual Studio and coding in C#.

I've seen samples of creating a database if it does not exist, but not what I'm looking for.

Does anyone have any code (C#) for using existing sqlite database already in Assets folder, instead of creating new database on Android device?

解决方案

You have to copy the database file from your Assets folder to somewhere on the device, and then use that in your application. Note that you only have to do this once, when your application first starts up.

这篇关于Xamarin的Andr​​oid C#的SQLite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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