Quantcast
Channel: Symantec Connect - ブログエントリ
Viewing all articles
Browse latest Browse all 5094

Workflow/ServiceDesk - How To Extract the (local.orm) Sql Connection String

$
0
0
Code (Script) Component Sql Connection String Extractor

Configure a Code (Script) Component as such:

result_variable.png

source_code.png

// Using namespace (one per line):

System
Symantec.SymQ
LogicBase.Core.Messaging
LogicBase.Core.Messaging.Implementations



// Source code:

string connectionString = "";

try {
        IMessageExchange exchange = MessageExchangeFactory.GetExchange(SymQConstants.Q_CONFIG);
        Message message = exchange.Get("SymQ_Local_Defaults");
        ExchangeConfiguration config = (ExchangeConfiguration)message.PayLoad;
        AbstractExchangeConfiguration localOrm = config.GetConfiguration("local.orm");
        RelationalMapperExchangeConfiguration mapper = (RelationalMapperExchangeConfiguration)localOrm;
        connectionString = mapper.ConnectionString;
}
catch (Exception e) {
        return e.Message;
}

return connectionString;

Once completed, you will be able to use the 'SqlConnectionString' variable in your project.


Viewing all articles
Browse latest Browse all 5094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>