try { //Check for Clr-specific connection using (SqlConnection connection = new SqlConnection("context connection=true")) { return "get settings from sql table"; } } catch (Exception ex) { return "get settings from config-file"; }
SqlContext.IsAvailable
if (Microsoft.SqlServer.Server.SqlContext.IsAvailable) { // Load the settings from the SQL table } else { // Load the settings from the config file }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)