This project is read-only.

List all applications from SSODB

Jan 9, 2009 at 9:13 PM

Thanks for the source code... The windows application in the souce code is good for creating and retrieving SSO Config Applications but when we try to open the created application, the dropdown list is not fill the list of applications from the database, of type "Config Store".
I had to get that by making a small change in the code...

I replaced the existing code...

 

public

 

List<string> GetApplications()

 

{

 

 

 

 

//get the app list:

 

 

 

 

 

 

string[] applications = null;

 

 

string[] descs;

 

 

string[] contacts;

 

 

try

 

 

 

 

 

{

 

this.Mapper.GetApplications(out applications, out descs, out contacts);

 

}

 

catch (COMException comEx)

 

{

 

this.HandleCOMException(comEx, 0);

 

}

 

List<string> apps = new List<string>(applications.Length);

 

apps.AddRange(applications)

 

 

 

 

 

 

 

 

return apps;

 

}

 

 

 

 



WITH


 

public

 

List<string> GetApplications()

 

{

 

SqlConnection conn = new SqlConnection("Integrated Security=SSPI;Initial Catalog=SSODB;Data Source=(local);");

 

 

SqlCommand sqlComm = new SqlCommand("SELECT ai_app_name FROM SSOX_ApplicationInfo ORDER BY ai_app_name",conn);

 

 

SqlDataReader dr;

 

 

string applications;

 

 

List<string> apps = new List<string>(); 

 

conn.Open();

dr = sqlComm.ExecuteReader();

 

while (dr.Read())

 

{

applications = (

string)dr.GetValue(0);

 

apps.Add(applications);

}

dr.Close();

conn.Close();

 

 

return apps;

 

}