Code (Script) Component Sql Connection String Extractor
Configure a Code (Script) Component as such:
// 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.