I made an application in which the sql compact file (.sdf) will be allocated on a network PC and I wanted to have the option to change the database path whenever I want. For all DatagridView to see this new path, I believe I would have to change the path in the Settings.Designer.cs file where I have the following line:
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=|DataDirectory|\Database.sdf")]
Am I right?
The problem is that I'm trying to put a "global" variable where you have stored the file's path in place of # | DataDirectory | \ Database.sdf #
[global::System.Configuration.DefaultSettingValueAttribute("Data Source='" + globalinfos.bancoDeDados + "'")]
But it gives me the following error:
Error 1 An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type D: \ PROJECTS \ HMS \ HMS 30-05-2017- NEW PHASE - V2 \ HMS \ hms \ hms \ hms \ Properties \ Settings.Designer.cs 29 68 hms