Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


FabienV
2013-12-03T15:41:05Z
Hi,

we have multiple servers in our organisation I'm trying to automate some tasks (like changing and managing connection parameters).
But I can't seem to find the right way to create an oracle connection, my parameters do not look anything like what I see when I retrieve an existing connection.

What is the encoding/method used to set the SQLConnection.ParameterValue from string to byte[]? Do you have some code snippets to provide?

thanks,
Fabien
Sponsor
Forum information
Support
2013-12-03T15:47:17Z
These parameters are encrypted. You can encrypt using ServerObject.Encrypt() method but you cannot decrypt it.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
FabienV
2013-12-03T16:00:45Z
thanks, I'm fine with just encrypting but cannot find this method on the server class which class does it belong to?
I'm using version 6.0.9
Support
2013-12-03T16:07:17Z
Sorry, could be ClientObj.Encrypt()
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
FabienV
2013-12-03T16:43:18Z
thanks that's it

here is the code snippet for those interested (oracle connection)

connection = new ConnectionClass();
connection.Name = "dbname@serverid";
connection.ProtocolType = ConnectionClass.ProtocolT.SQL;
connection.SecurityMode = ConnectionClass.SecurityModeT.Explicit;
connection.SQLConnection.DataBaseType = SQLConnectionClass.DatabaseT.Oracle;
connection.SQLConnection.DataProvider = SQLConnectionClass.DataProviderT.DirectOracle;

connection.SQLConnection.ConnectionTypeId = 224;
connection.SQLConnection.StorageType = SQLConnectionClass.StorageT.Database;
connection.SQLConnection.WizardId = 1;
string connection_string = "Data Source=serverid;User Id=dbname;Password=dbpassword;";
connection.SQLConnection.ConnectionString = ClientObject.Encrypt(connection_string);
SQLConnectionParameterClass p_server = new SQLConnectionParameterClass();
p_server.ParameterName = "Data Source";
p_server.ParameterValue = ClientObject.Encrypt("serverid");

connection.SQLConnection.ConnectionParameters.Add(p_server);

SQLConnectionParameterClass p_user_id = new SQLConnectionParameterClass();
p_user_id.ParameterName = "User Id";
p_user_id.ParameterValue = ClientObject.Encrypt("dbname");

connection.SQLConnection.ConnectionParameters.Add(p_user_id);

SQLConnectionParameterClass p_password = new SQLConnectionParameterClass();
p_password.ParameterName = "Password";
p_password.ParameterValue = ClientObject.Encrypt("dbname");

connection.SQLConnection.ConnectionParameters.Add(p_password);

ServerObject.Connections.Add(connection);

Support
2013-12-05T08:07:21Z
Thanks for the feedback!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Similar Topics
Users browsing this topic
Scroll to Top