使用密码保护的SQL Compact数据库文件 [英] using a password protected sql compact database file

查看:117
本文介绍了使用密码保护的SQL Compact数据库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,
我收到来自QueriesTableAdapter的查询的结果如下,出现以下错误.您能否建议在使用queryTableAdapter之前如何确认密码.

Hi Friends,
I am recieving following error as a result of calling a query from QueriesTableAdapter as follows. Can you suggest how can I confirm Password before using the queriesTableAdapter.

 <br />
var query = new DBDataSetTableAdapters.QueriesTableAdapter();<br />
            <br />
            var count = (int)query.isEmpity();


在第二行代码中出现错误.

指定的密码与数据库密码不匹配. [数据源= D:\ jwork \所有RFID项目CODE 1.0.4 \ TELLMEDIcLite \ TELLMEDIC \ bin \ Debug \ DB.sdf]
问候


at the second line of code I get an error.

The specified password does not match the database password. [ Data Source = D:\jwork\All RFID Projects CODE 1.0.4\TELLMEDIcLite\TELLMEDIC\bin\Debug\DB.sdf ]
Regards

推荐答案

从以下内容开始:
SQL Server压缩错误
[^ ]

我猜您会-间接地-在该页面上找到错误的解决方案,或者-可能不是,因为您实际上必须使用SSCE_M_INVALIDPASSWORD搜索解决方案.这将导致:
如何测试数据库是否已加密? [ ^ ]

密码保护数据库 [
Start by looking at this:
SQL Server Compact Errors
[^]

I guess you''ll - indirectly - find the solution for your error on that page, - or maybe not as you would actually have to search for a solution using SSCE_M_INVALIDPASSWORD. This would then lead to:
How to test if a DB is encrypted?[^]

Password Protecting a Database[^]

Try using SqlCeConnection.Open - if it fails with SSCE_M_INVALIDPASSWORD you''ll know that the db is encrypted.

Regards
Espen Harlinn


我不确定这是不是错字,但isEmpity()似乎是错的.
I am not sure if this is a typo or not, but isEmpity() seems to be wrong.


一种方式是你在应用程序的开头获取一些内容,然后使用try-catch块包装操作.在那里,您可以处理所有可能的已知启动"问题,例如错误的用户名或密码等.
One way is that you fetch something in the beginning of your app and wrap the operation with try-catch block. There you handle all the possible known ''startup'' problems such as bad username or password etc.


这篇关于使用密码保护的SQL Compact数据库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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