Hello,
please note that i tried to get system settings value following the below url:
I used 2 Methods:
- My System Settings code is: "UsrServerName"
Method 1:
- var ServerName= "UsrServerName";
- Terrasoft.Core.Configuration.SysSettings.SetValue(UserConnection, ServerName, "Server Name");
Method 2:
- var ServerName= "UsrServerName";
- var appConnection = HttpContext.Current.Application["AppConnection"] as AppConnection;
- var settingVal = Terrasoft.Core.Configuration.SysSettings.GetValue(appConnection.SystemUserConnection, ServerName);
but it doesn't work
Please help
Like
Hello,
You need to check if you don't have duplicates in the SysSettingsValue table that can lead to the fact that the system modifies value for the duplicate, but not for the value displayed when opening this system setting in the "System settings" section. Additionally, what exactly doesn't work? Can you share more details?
Best regards,
Oscar
Oscar Dylan,
Hello Oscar,
Please note that I don't have a duplicate in SysSettingsValue, and the error is below:
And my code is on the below:
var NameServer = "UsrServerName";
var ServerName = Terrasoft.Core.Configuration.SysSettings.GetValue(UserConnection, NameServer, "Server Name");
Georges,
Can you please clarify how have you identified that there are no duplicates? Additionally - if you are trying to set the value for the setting from the C# class and you have these compilation errors then this class won't work since it's not published. These errors should be fixed first.
Best regards,
Oscar