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

C#

 
AnswerRe: Map Control Pin
Bernhard Hiller16-Apr-10 3:08
Bernhard Hiller16-Apr-10 3:08 
Questiondatabase connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy14-Apr-10 20:54
professionalChesnokov Yuriy14-Apr-10 20:54 
AnswerRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad14-Apr-10 22:12
Stanciu Vlad14-Apr-10 22:12 
AnswerRe: database connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy14-Apr-10 23:07
professionalChesnokov Yuriy14-Apr-10 23:07 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad15-Apr-10 0:07
Stanciu Vlad15-Apr-10 0:07 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Chesnokov Yuriy15-Apr-10 0:55
professionalChesnokov Yuriy15-Apr-10 0:55 
GeneralRe: database connection error with sa user in SQL Express 2005 Pin
Stanciu Vlad15-Apr-10 1:04
Stanciu Vlad15-Apr-10 1:04 
Questiondatagridview Pin
ali_reza_zareian14-Apr-10 20:02
ali_reza_zareian14-Apr-10 20:02 
AnswerRe: datagridview Pin
thatraja14-Apr-10 20:14
professionalthatraja14-Apr-10 20:14 
AnswerRe: datagridview Pin
Not Active14-Apr-10 20:16
mentorNot Active14-Apr-10 20:16 
Questionhow to bind data to datagridview which has combobox and checkbox columns Pin
NarVish14-Apr-10 19:24
NarVish14-Apr-10 19:24 
AnswerRe: how to bind data to datagridview which has combobox and checkbox columns Pin
Abhinav S14-Apr-10 19:36
Abhinav S14-Apr-10 19:36 
QuestionHTTPWebRequest to Increase Processing Speed Pin
Johndas14-Apr-10 19:07
Johndas14-Apr-10 19:07 
AnswerRe: HTTPWebRequest to Increase Processing Speed Pin
Not Active14-Apr-10 20:49
mentorNot Active14-Apr-10 20:49 
QuestionHow to set colour column in datagridview Pin
NarVish14-Apr-10 18:09
NarVish14-Apr-10 18:09 
AnswerRe: How to set colour column in datagridview Pin
ali_reza_zareian14-Apr-10 20:07
ali_reza_zareian14-Apr-10 20:07 
QuestionReturn type error Pin
mprice21414-Apr-10 17:28
mprice21414-Apr-10 17:28 
AnswerRe: Return type error Pin
ali_reza_zareian14-Apr-10 20:14
ali_reza_zareian14-Apr-10 20:14 
GeneralRe: Return type error Pin
mprice21415-Apr-10 3:02
mprice21415-Apr-10 3:02 
QuestionMimic Active Directory browser... Pin
Jacob Dixon14-Apr-10 14:48
Jacob Dixon14-Apr-10 14:48 
I am having trouble figuring this out... even where to start. Basically I want to mimic the active directory browser. Listing all the OU's and their childs.

The hard part is I'm trying to do this backwards from what most people do I believe. What I have is a list of USERS and their DISTINGUISHEDNAME.

So:

I have a user:
CN=Jacob Dixon,OU=INFO TECH,OU=MAIN DIVISION,DC=company,DC=com

So what I did was:
string[] dn = usr.DistinguishedName.Split(',');
Array.Reverse(dn);


I then loop through each string ignoring EVERYTHING except for strings that start with "OU=". Anyone have an example on how to accomplish this?

I have tried something like this:
TreeNode root = new TreeNode();
TreeNode prev = new TreeNode();

foreach (string s in dn)
{
    if (s.Contains("OU="))
    {
        string tmp = s.Replace("OU=", string.Empty);

        if (string.IsNullOrEmpty(root.Text))
        {
            root.Text = tmp;
        }
        else
        {
            if (string.IsNullOrEmpty(prev.Text))
            {
                prev.Text = tmp;
                root.Nodes.Add(prev);
            }
            else
            {
                TreeNode n = new TreeNode();
                n.Text = tmp;

                prev.Nodes.Add(n);
                prev = n;
            }
        }
    }
}
tvUsers.Nodes.Add(root);


It does the root and children but it also inserts duplicates.. (I know I'm not checking right now for duplicates). I'm just having a hard time figuring this out..
QuestionEntity Framework and 'char' type mapping Pin
student_rhr14-Apr-10 10:21
student_rhr14-Apr-10 10:21 
QuestionWindows Service - Service Automatically stops when error is thrown Pin
Joe Brislin14-Apr-10 9:13
Joe Brislin14-Apr-10 9:13 
AnswerRe: Windows Service - Service Automatically stops when error is thrown Pin
PIEBALDconsult14-Apr-10 11:06
mvePIEBALDconsult14-Apr-10 11:06 
GeneralRe: Windows Service - Service Automatically stops when error is thrown Pin
Joe Brislin14-Apr-10 11:44
Joe Brislin14-Apr-10 11:44 
AnswerRe: Windows Service - Service Automatically stops when error is thrown Pin
Michel Godfroid14-Apr-10 12:56
Michel Godfroid14-Apr-10 12:56 

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.