如何给项目文件夹里面的文件夹路径创建一个sqlite数据库文件? [英] how to give a path to the folder inside of the project folder to create a sqlite database file?

查看:213
本文介绍了如何给项目文件夹里面的文件夹路径创建一个sqlite数据库文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用该文件路径替换连接字符串

i want to replace the connection string with that file path

推荐答案

如果您的意思是要在应用程序文件夹(或下面的文件夹)中创建文件)这是一个非常糟糕的主意。对应用程序文件夹的访问受到限制,并且可能会变得更加严重。此外,如果文件位于普通数据文件夹下,则更有可能备份文件。



考虑完全使用不同的文件夹 - 这可以帮助:我应该在哪里存储数据? [ ^ ]



然后连接字符串可以引用该文件(最好通过某种配置文件,具体取决于你如何配置文件)
If you mean you want to create a file within the application folder (or a folder below that) that it is a very bad idea. Access to Application folders is restricted, and likely to become more so. In addition, it is more likely that a file will be backed up if it is under a "normal" data folder.

Consider using a different folder altogether - this can help: Where should I store my data?[^]

The connection string can then reference that file (preferably via a config file of some sort, depending on how you do your config files)


这篇关于如何给项目文件夹里面的文件夹路径创建一个sqlite数据库文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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