C# 如何在C中对SQLite3数据库进行密码保护?

C# 如何在C中对SQLite3数据库进行密码保护?,c#,sqlite,C#,Sqlite,我已经到处搜索过了,到目前为止,我发现的东西由于某种原因不起作用:\ string connection = "Data Source=DB.db;Version=3;Pooling=True;Max Pool Size=100;"; SQLiteConnection sqlc = new SQLiteConnection(connection); sqlc.Open(); sqlc.SetPassword("password"); sqlc.Close(); 告诉我错误 An unha

我已经到处搜索过了,到目前为止,我发现的东西由于某种原因不起作用:\

string connection = "Data Source=DB.db;Version=3;Pooling=True;Max Pool Size=100;";
SQLiteConnection sqlc = new SQLiteConnection(connection);
sqlc.Open();  
sqlc.SetPassword("password");

sqlc.Close();
告诉我错误

An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'The invocation of the constructor on type 'Hotel_Manager.MainWindow' that matches the specified binding constraints threw an exception.' Line number '3' and line position '9'.
有人能告诉我我做错了什么吗


请注意,我已经有了一个与数据库交互的程序。直到现在我才尝试对其进行密码保护。

该错误与SQLite无关。我冒昧地猜测,您的XAML中有一个错误。如果注释掉SQLite位,代码会运行吗?如果去掉sqlc.SetPasswordpassword,代码会运行得很好;位:\您能更新该异常的全文吗?怀疑内部异常会在这里给出答案…@DeanWard刚刚做了!它基本上指向密码位所在的那一行。@Lloyd我很确定它不是这样工作的?:不过还是要谢谢你