New Style SSO Available on Codeplex
If you are working with BizTalk you know the dilemma, where do I store my configuration data. Could be on several locations. Have a read of this article to have some in-dept information.
I created a base class SSOBaseFunctionality thad deals with storing and loading configuratioin data to and from SSO. So if you want to store a specific class in SSO just make sure it inherits from SSOBaseFunctionality and you are ready to go.
The project is on Codeplex.
Your class could simply look like this.
[Serializable]
public class SampleConnectionData:SSOConfigItem
{
public SampleConnectionData(string ApplicationName)
{
base.SSO_ApplicationSettingName = ApplicationName;
}
public SampleConnectionData()
{
}
private string dataSource = string.Empty;
private string database = string.Empty;
private string applicationName = string.Empty;
private string userName = string.Empty;
private string password = string.Empty;
private bool trustedConnection = false ;
public bool TrustedConnection
{
get { return trustedConnection; }
set { trustedConnection = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public string UserName
{
get { return userName; }
set { userName = value; }
}
public string ApplicationName
{
get { return applicationName; }
set { applicationName = value; }
}
public string DataSource
{
get { return dataSource; }
set { dataSource = value; }
}
public string Database
{
get { return database; }
set { database = value; }
}
}
And then you will have functionality like this :
// Create a SSO connection class.
SampleConnectionData objConnection = new SampleConnectionData(“SomeApplicationName”);
// Set properties
objConnection.TrustedConnection = true;
objConnection.DataSource = “(Local)”;
objConnection.Database = “Master”;
objConnection.ApplicationName = “DemonstrateUsage”;
// Create the applications
objConnection.CreateApplication();
// Save the application
objConnection.Save();
// Get a new Object
SampleConnectionData OtherConnection = new SampleConnectionData(“SomeApplicationName”);
// Load properties from SSO Configuration Store
OtherConnection.Load()
Comments: 0