Embedding SQLCE into a C# desktop application

  • I have a desktop application that I have created in C# that is using SQLCE as the database. I would like to embed it into the application so that the user will only see the .exe application file.

    I know that all I have to do in C# is to set a property on the sdf file in order to make it embedded, but I'm not sure how to reference it from the application once it has been embedded.

    My question is, if I embed SQLCE in the application, how do I reference it in a ConnectionString?

    Thanks in advance. 🙂

  • After reading some other posts, I think I may have been under an incorrect assumption. Hopefully, somebody can help clarify it for me.

    The original concept I was working under was that if I embedded SQLCE into my application, it would be part of the .exe file that is created and I would be able to access that database while it is still in the .exe file (and the end-user wouldn't have any access to that database, other than through the UI).

    Now, it appears that although the database itself is, indeed, embedded inside the .exe file, the only way to use the database is to write it to disk. And, if any changes are made to the database, those changes can't be written back to the database within the .exe file.

    Am I correct in my "new" assumption? If I want to 'hide' the database from the user, what are my options? So far, I've come up with:

    1. Using a password on the database.

    2. Encrypting the database.

    Are there any others that might work for me?

    Thanks.

    Ron

  • Dear i am working on same kind of application and my question is same that what can i do for hiding database from user other than Encrypting or setting a password?

  • If you can tell on how to embed this in .exe so after installation user don't have to copy paste .sdf file manually.

    That will be great if you share your knowledge.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply