Noor-coder
Noor-coder

Reputation: 19

Shared database .MDF for two separate projects "C#,WINFORM"

I created a project to generate the license key for a main project. This project must save the license key in the main project database, in the license table. If I use the same path with DataDirectory for both projects, a second instance of the database will be created and I will not be able to retrieve the license key from the main project because it will be saved in the second instance. and I can't use an absolute path, because I will configure an installer for the projects to deploy them to different clients. Please help me.

C#, Winforms, ADO.NET

Thank you.

<connectionStrings>
    <add name="maDatabase" 
         connectionString="Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Database_Inovatio.mdf;Integrated Security=True" 
         providerName="System.Data.SqlClient" />
</connectionStrings>

Upvotes: 0

Views: 30

Answers (0)

Related Questions