==================== public SQLiteHelper(){}//数据库连接字符串(web.conf" />

sqlite数据库时不进的出现Unable to open the database file错误

来源:互联网  时间:2016/6/28 19:04:16

关于网友提出的“ sqlite数据库时不进的出现Unable to open the database file错误”问题疑问,本网通过在网上对“ sqlite数据库时不进的出现Unable to open the database file错误”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: sqlite数据库时不进的出现Unable to open the database file错误
描述:

        ==================== public SQLiteHelper()     {     }     //数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库.              public static string connectionString = "Data Source=" + System.Web.HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["ConnectionSQLite"]); ===============  public static int ExecuteSql(string SQLString)     {         using (SQLiteConnection connection = new SQLiteConnection(connectionString))         {             using (SQLiteCommand cmd = new SQLiteCommand(SQLString, connection))             { ========================= SQLiteHelper.cs中对数据库操作的代码都有加using来自动关闭,可网站还是时不时的出现这错误,也不知道是在什么情况下出现的。出现错误后重新上传web.config或app_code下的cs文件,就可以了。 很苦恼,这有可能是在什么情况下出现的错误的,网站访问量很小。


解决方案1:

给数据库文件及数据库文件所在文件夹设读写权限。

解决方案2:

动态更新web.config文件会导致应用程序重启。

上一篇jq怎么弄修改删除?
下一篇菜鸟求助linq
明星图片
相关文章
《 sqlite数据库时不进的出现Unable to open the database file错误》由码蚁之家搜集整理于网络,
联系邮箱:mxgf168#qq.com(#改为@)