Click here to Skip to main content
15,914,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to detetmine that sql was installed on computer or not ? Pin
Paul Conrad5-Aug-07 5:06
professionalPaul Conrad5-Aug-07 5:06 
QuestionCrystal Report working with generic collections Pin
Developer6114-Aug-07 22:44
Developer6114-Aug-07 22:44 
Questionwhat is exe of search option in win xp Pin
San@Coding4-Aug-07 22:11
San@Coding4-Aug-07 22:11 
AnswerRe: what is exe of search option in win xp Pin
Luc Pattyn4-Aug-07 23:56
sitebuilderLuc Pattyn4-Aug-07 23:56 
Questiondraw a box on screen Pin
hamid_m4-Aug-07 21:50
hamid_m4-Aug-07 21:50 
AnswerRe: draw a box on screen Pin
ArunkumarSundaravelu6-Aug-07 5:22
ArunkumarSundaravelu6-Aug-07 5:22 
QuestionProperties Window [modified] Pin
sniper474-Aug-07 21:22
sniper474-Aug-07 21:22 
AnswerRe: Properties Window Pin
Hessam Jalali4-Aug-07 22:36
Hessam Jalali4-Aug-07 22:36 
GeneralRe: Properties Window Pin
sniper475-Aug-07 0:31
sniper475-Aug-07 0:31 
GeneralRe: Properties Window Pin
J. Dunlap5-Aug-07 8:48
J. Dunlap5-Aug-07 8:48 
QuestionC# error " not all code paths return a value" Pin
jayarajmrj4-Aug-07 19:36
jayarajmrj4-Aug-07 19:36 
AnswerRe: C# error " not all code paths return a value" Pin
Hessam Jalali4-Aug-07 21:27
Hessam Jalali4-Aug-07 21:27 
NewsRe: C# error " not all code paths return a value" Pin
javajohn5-Aug-07 5:42
javajohn5-Aug-07 5:42 
Questionmasterpage Pin
TAREQ F ABUZUHRI4-Aug-07 12:23
TAREQ F ABUZUHRI4-Aug-07 12:23 
AnswerRe: masterpage Pin
Paul Conrad4-Aug-07 12:53
professionalPaul Conrad4-Aug-07 12:53 
GeneralRe: masterpage Pin
Paul Conrad4-Aug-07 13:08
professionalPaul Conrad4-Aug-07 13:08 
GeneralRe: masterpage Pin
Malcolm Smart4-Aug-07 13:09
Malcolm Smart4-Aug-07 13:09 
GeneralRe: masterpage Pin
Paul Conrad4-Aug-07 13:15
professionalPaul Conrad4-Aug-07 13:15 
QuestionArraylist mystery Pin
zuidgeest4-Aug-07 9:41
zuidgeest4-Aug-07 9:41 
Today I ran into a problem with arraylists. And I can't seem to get why it doen't work. I have made the following function as below
When I use this function using statement A: result.Add(new string[] {subResult[0], subResult[1], subResult[2]}); I get this:

sr: rupert@doomsday.nl
sr: Rupert
sr: Monkey
sr: test@test.nl
sr: bart
sr: zuidgeest
rupert@doomsday.nl
test@test.nl

when I use statement B I get this output

sr: rupert@doomsday.nl
sr: Rupert
sr: Monkey
sr: test@test.nl
sr: bart
sr: zuidgeest
test@test.nl
test@test.nl

Notice the difference in the last two lines. Somehow when I use statement B I am left with only the second rusult in my arraylist twice instead of two different results. I need statement B because I cannot predict in advance what the amount of elements in each string array will be. Annyone want to tell me what's wrong? (Not that it should matter but this is on mono)


public ArrayList Search(string baseDN, int searchScope, string filter, string[] attributes)
{
ArrayList result = new ArrayList();

if (attributes == null || attributes.Length == 0)
{
return (result);
}

LdapSearchQueue queue = connection.Search ( baseDN, searchScope, filter, attributes, false, (LdapSearchQueue) null, (LdapSearchConstraints) null);

LdapMessage message;
string[] subResult = new string[attributes.Length];


while ((message = queue.getResponse()) != null)
{

if (message is LdapSearchResult)
{
int counter = 0;
LdapEntry entry = ((LdapSearchResult) message).Entry;
LdapAttributeSet attributeSet = entry.getAttributeSet();
foreach (string attributeName in attributes)
{
LdapAttribute attribute = attributeSet.getAttribute(attributeName);
subResult[counter] = attribute.StringValue;
counter++;
//Console.WriteLine("attr: " +attribute.StringValue + counter);
}
Console.WriteLine("sr: " + subResult[0]);
Console.WriteLine("sr: " + subResult[1]);
Console.WriteLine("sr: " + subResult[2]);

// A this works
//result.Add(new string[] {subResult[0], subResult[1], subResult[2]});
// B this doens't?
result.Add(subResult);

}

}

foreach(object a in result)
{
Console.WriteLine(((string[])a)[0]);
}
return(result);

}
AnswerRe: Arraylist mystery Pin
Guffa4-Aug-07 13:19
Guffa4-Aug-07 13:19 
GeneralRe: Arraylist mystery Pin
zuidgeest5-Aug-07 5:27
zuidgeest5-Aug-07 5:27 
Questionget page name Pin
TAREQ F ABUZUHRI4-Aug-07 9:27
TAREQ F ABUZUHRI4-Aug-07 9:27 
AnswerRe: get page name Pin
Luc Pattyn4-Aug-07 9:41
sitebuilderLuc Pattyn4-Aug-07 9:41 
GeneralRe: get page name Pin
Urs Enzler4-Aug-07 23:19
Urs Enzler4-Aug-07 23:19 
AnswerRe: get page name Pin
Hessam Jalali4-Aug-07 23:37
Hessam Jalali4-Aug-07 23:37 

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.