Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3337000
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:12:08+00:00 2026-05-18T00:12:08+00:00

i am using role provider and have it managing users on my intranet via

  • 0

i am using role provider and have it managing users on my intranet via their windows logins.
how can i pull their email address and maybe some other user content from asp.net using their user info?

do i need to hook into active directory? a sample fir this would be great if this is the way to go

thanks all

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:12:09+00:00Added an answer on May 18, 2026 at 12:12 am

    i folks, here is how you can pull any data points from Active Directory. in my code i get the user’s email

    SELECT mail FROM 'LDAP://DC=Domain,DC=win,DC=ml,dc=COM' WHERE samaccountname = 'userName'
    
                  System.Data.OleDb.OleDbConnection con;
                  System.Data.OleDb.OleDbDataAdapter da;
                  System.Data.OleDb.OleDbCommand cmd;
                  System.Data.DataTable dt = new System.Data.DataTable();
    
                  con = new System.Data.OleDb.OleDbConnection("Provider=ADsDSOObject;dsn=Active Directory Provider");
                  con.Open();
    
                  //                Create a command object on this connection
    
                  cmd = new System.Data.OleDb.OleDbCommand(this.tbQuery.Text, con);
                  da = new System.Data.OleDb.OleDbDataAdapter();
                  da.SelectCommand = cmd;
    
                  try
                  {
                        da.Fill(dt);
                        this.dgResults.DataSource = dt;
                  }
                  catch (System.Data.OleDb.OleDbException exc)
                  {
                        MessageBox.Show(exc.Message);
                  }
                  con.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

HI, I am implementing a custom role provider in my nhibernate application I have
I have a very simple migration which was created using the generator class AddEmailToUsers
I have an application in Asp.net and using sql server to store user information.
My requirement is to create a framework that can consume standard ASP.NET Profile provider.
I have a GWT MVP application using Activities and Places. This is inspired by
I have mixed web application web forms & mvc2. At the moment i have
This is my first question on this site, and I only have a basic
In my app I need to check the roles for the loggind user to
I am developing an application to help my office track and manage reviews. In
In the C2DM sign up form , (out of many things) we are asked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.