SQL logic error or missing database

无法启动服务。System.Data.SQLite.SQLiteException (0x80004005): SQL logic error or missing database
no such table: hk_AppConfig
   在 System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   在 System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   在 System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
   在 System.Data.SQLite.SQLiteDataReader.NextResult()
   在 System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   在 System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   在 System.Data.SQLite.SQLiteCommand.ExecuteDbDataReader(CommandBehavior behavior)
   在 System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   在 Dapper.SqlMapper.<QueryImpl>d__121`1.MoveNext()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 Dapper.SqlMapper.Query[T](IDbConnect...

写了一个windows服务,用控制台测试是没有问题的,用服务的方式却根本无法启动。查看windows事件日志,报以上错误。

数据库配置是这样的:

  <connectionStrings>

    <add name="default" connectionString="Data Source= order.sqlite" providerName="System.Data.SQLite"/>

  </connectionStrings>

后来看到网上大家都用的是全路径,随即修改成这样:

  <connectionStrings>

    <add name="default" connectionString="Data Source= E:\订单服务\order.sqlite" providerName="System.Data.SQLite"/>

  </connectionStrings>

Windows服务顺利启动

转载于:https://www.cnblogs.com/westfruit/p/5607731.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值