Click here to Skip to main content
15,925,113 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can't connect directly to peer Pin
Nicholas Butler23-Feb-06 23:36
sitebuilderNicholas Butler23-Feb-06 23:36 
AnswerRe: Can't connect directly to peer Pin
Divyang Mithaiwala24-Feb-06 2:50
Divyang Mithaiwala24-Feb-06 2:50 
QuestionCustomizing Tree Node Pin
gubber23-Feb-06 23:24
gubber23-Feb-06 23:24 
AnswerRe: Customizing Tree Node Pin
mav.northwind23-Feb-06 23:36
mav.northwind23-Feb-06 23:36 
AnswerRe: Customizing Tree Node Pin
Nicholas Butler23-Feb-06 23:47
sitebuilderNicholas Butler23-Feb-06 23:47 
AnswerRe: Customizing Tree Node Pin
gubber23-Feb-06 23:54
gubber23-Feb-06 23:54 
QuestionCustomize Toolbar Pin
Maqsood Ahmed23-Feb-06 22:22
Maqsood Ahmed23-Feb-06 22:22 
QuestionLDAP cache to increase the performance in C# ASP.net Pin
urcode23-Feb-06 22:04
urcode23-Feb-06 22:04 
I developed a LDAP concept in C#, Having Groups combo, under every group nearly 3,000 users are there. Under Groups combo selectedindexchange() event I am filling Users combo(having 3,000 users nearly). For filling it is taking nearly 2min. In between if we select another group, Blank screen is coming. That is system is hanged and performance is very slow. To increase its performace i want to use cache concept. For that I want to store users under particular group in cache, when the second time same Group combo is selected It should come from cache but not from LDAP server.
How to develope it? Any body help me...it is very urgent to my client....My code is:

private void cboGroups_SelectedIndexChanged(object sender, System.EventArgs e)
{
cboUsers.Items.Clear();
Response.Flush();
try
{

LoadUsers("LS1");
}
catch(Exception ex)
{
if(ex.Message=="The server is not operational")
{
try
{
LoadUsers("LS2");
}
catch(Exception ex1)
{
if(ex1.Message=="The server is not operational")
RegisterStartupScript("script","alert('LDAP Server seems to be down, please contact City Insight administrator.');");
else
throw new Exception(ex1.Message);
}
}
else
throw new Exception(ex.Message);
}

}



private void LoadUsers(string ldapServerID)
{
string IPassAddress,IPassUsername,IPassPassword;
if(ldapServerID=="LS1")
{
IPassAddress=ConfigurationSettings.AppSettings["IPassAddress"].ToString();
IPassUsername=ConfigurationSettings.AppSettings["IPassUsername"].ToString();
IPassPassword=ConfigurationSettings.AppSettings["IPassPassword"].ToString();
}
else
{
IPassAddress=ConfigurationSettings.AppSettings["AltIPassAddress"].ToString();
IPassUsername=ConfigurationSettings.AppSettings["AltIPassUsername"].ToString();
IPassPassword=ConfigurationSettings.AppSettings["AltIPassPassword"].ToString();
}


cboUsers.Items.Clear();

if(cboGroups.Items.Count >0)
{
string ou=Session["ou"].ToString();
//string AdsiPath="LDAP://211.114.211.31/l="+cboGroups.SelectedItem.Text+",ou="+ou+",o=Managed iPass,dc=sc-m.net";
string AdsiPath=cboGroups.SelectedValue.ToString();
DirectoryEntry de = new DirectoryEntry(AdsiPath);
//de.Username="cn=LDAP";
//de.Password="LTDldn51";
de.Username=IPassUsername;
de.Password=IPassPassword;

DataSet ds=new DataSet();
DataTable newTbl=new DataTable();
DataColumn dc1=new DataColumn();
newTbl.Columns.Add("uid");
newTbl.Columns.Add("path");
ds.Tables.Add(newTbl);

foreach (DirectoryEntry ce in de.Children)
{
// //if(ce.SchemaClassName.Equals("inetOrgPerson"))
// //{
// ListItem newItemList = new ListItem();
// newItemList.Text=ce.Properties["uid"].Value.ToString();
// newItemList.Value = ce.Path.ToString();
// cboUsers.Items.Add(newItemList);
// //}

DataRow defRow = ds.Tables[0].NewRow();
defRow[0] =ce.Properties["uid"].Value.ToString();;
defRow[1] = ce.Path.ToString();
ds.Tables[0].Rows.Add(defRow);
ds.AcceptChanges();
}
DataView view = ds.Tables[0].DefaultView;
view.Sort = "uid";
cboUsers.DataSource = view;
cboUsers.DataTextField = "uid";
cboUsers.DataValueField = "path";
cboUsers.DataBind();
ListItem newItem=new ListItem();
newItem.Text="[Select One]";
newItem.Value="0";
cboUsers.Items.Insert(0,newItem);
de.Close();
}

}


Kiran
QuestionZedGraph Help Please Pin
Jeyakumar_indian23-Feb-06 21:14
Jeyakumar_indian23-Feb-06 21:14 
QuestionMapping Excel columns with XML data (XML data integration) programmatically Pin
winpoorni23-Feb-06 18:50
winpoorni23-Feb-06 18:50 
AnswerRe: Mapping Excel columns with XML data (XML data integration) programmatically Pin
sathish s23-Feb-06 19:42
sathish s23-Feb-06 19:42 
Questionconversion of image format Pin
relsirc23-Feb-06 18:33
relsirc23-Feb-06 18:33 
AnswerRe: conversion of image format Pin
Guffa23-Feb-06 18:50
Guffa23-Feb-06 18:50 
AnswerRe: conversion of image format Pin
Jon Sagara23-Feb-06 19:19
Jon Sagara23-Feb-06 19:19 
QuestionHow to get all IMG Tags from local HTML File to edit src properties? Pin
takkung23-Feb-06 17:11
takkung23-Feb-06 17:11 
AnswerRe: How to get all IMG Tags from local HTML File to edit src properties? Pin
Robin Panther23-Feb-06 21:47
Robin Panther23-Feb-06 21:47 
Questionvalidation Pin
leelaraj23-Feb-06 16:56
leelaraj23-Feb-06 16:56 
AnswerRe: validation Pin
Khawar Abbas123-Feb-06 18:19
Khawar Abbas123-Feb-06 18:19 
GeneralRe: validation Pin
leelaraj23-Feb-06 21:09
leelaraj23-Feb-06 21:09 
AnswerRe: validation Pin
goyal manish23-Feb-06 23:43
goyal manish23-Feb-06 23:43 
QuestionThreadAbortException and SQL? Pin
Kuira23-Feb-06 16:54
Kuira23-Feb-06 16:54 
AnswerRe: ThreadAbortException and SQL? Pin
S. Senthil Kumar23-Feb-06 17:35
S. Senthil Kumar23-Feb-06 17:35 
AnswerRe: ThreadAbortException and SQL? Pin
Le centriste23-Feb-06 18:30
Le centriste23-Feb-06 18:30 
GeneralRe: ThreadAbortException and SQL? Pin
Kuira9-Mar-06 15:59
Kuira9-Mar-06 15:59 
QuestionBindingsource & Tableadapters Pin
monrobot1323-Feb-06 16:35
monrobot1323-Feb-06 16:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.