SQL压缩数据库.sdf文件的连接字符串问题 [英] Connection string problems with SQL compact database .sdf file

查看:89
本文介绍了SQL压缩数据库.sdf文件的连接字符串问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将一个简单的Windows应用程序部署到测试计算机(而不是我的开发计算机).我在解决方案中使用SQL Compact .sdf数据库文件.当我发布解决方案并将其安装在测试计算机上时,出现此错误路径为 无效,请检查数据库的目录它告诉我连接字符串是我构建应用程序时一直设置的时间: 

I am trying to deploy a simple windows application to a test computer (not my development computer). I am usinf a SQL compact .sdf database file in my solution. When I publish the solution and install it on the test computer I get this error "the path is not valid check the directory for the database" and it shows me that the connection string is what is was set to this whole time while I built the app which is : 

C:\ Users \ Eamon \ Desktop \ VT版本\ VendorTracker 2.0 \ VendorTracker 2.0 \ Database1.sdf"

C:\Users\Eamon\Desktop\VT versions\Vendor Tracker 2.0\VendorTracker 2.0\Database1.sdf"

 

我尝试将连接字符串更改为在测试计算机上的确切位置,但是仍然出现错误.我在俯视什么吗?当我将应用程序部署到另一个应用程序时,如何获取放入Windows应用程序中的.sdf数据库 计算机?糊涂了.

I've tried changing the connection string to exactly where it would be on the test computer but I still get the error. Am I overlooking something? How to a take the .sdf databse that I put in my windows application, along when I deploy my app to another computer? Confused.

 

 

推荐答案

 您如何指定sdf文件路径?您的应用程序是否将路径存储在注册表中,还是有一些缓存?看来您的更改确实适用.您可以重新构建应用程序以使更改生效吗?

  How did you specify your sdf file path? Did your application store the path in the registry or is there some cache? It seems that your change does apply. Could you rebuild the application to have the change come into effect?


这篇关于SQL压缩数据库.sdf文件的连接字符串问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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