Question

I used following code that mention on this post Do not overwrite settings.settings file with clickonce but it is not working for my connection string that stored in setting with application scope, I am in doubt that this method work for user scope only or both application and user scope ?

if (Settings.Default.upgradeRequired)
  {
    Settings.Default.Upgrade();
    Settings.Default.upgradeRequired = false;
    Settings.Default.Save();
  }
Was it helpful?

Solution

I come up with that by adding one more setting named "userconnection" Scope:User then every time that user must set its connection string then this "userconnection" updated, Then in main point of my application check if userconnection(User Scope)!=ConnectionString(Applicaiton Scope) then try to change application ConnectionString to user customized one which was stored in userconnection properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top