I built a small app with VS 2010 in WPF. I have used to store data in SQL lite. I have bound a dropdown field from SQL lite dataconnection. When I run this application in VS it was worked fine. And published it as a click-once app. I have added SQL Lite.db file to application files and it appears in Project Properties -> Publish tab -Application Files.

I set the file's Build Action to "Content", and in Application files, set it to "Include". But still the dropdown field doesn't have any values.

有帮助吗?

解决方案

most likely the path to database gets lost. See Accessing Local and Remote Data in ClickOnce Applications - you need to make your sqlite file as Data (not Content as you did), and use ApplicationDeployment.CurrentDeployment.DataDirectory folder as a base folder for it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top