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 6797845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:39:32+00:00 2026-05-26T18:39:32+00:00

ASP.NET MVC3 newb here. I am working on a MVC3 intranet application that uses

  • 0

ASP.NET MVC3 newb here.

I am working on a MVC3 intranet application that uses windows authentication. Windows auth is setup and ready to go no problem.

What I need to happen is to capture the username (Domain\first.last) whenever a user accesses the app for the first time and then store that information into a database and associate that name to a another unique identifier (numeric and auto-incremented).

I already found a way to get the username:

string user = WindowsIdentity.GetCurrent().Name;

What I am having an issue with is taking that variable and storing it in my database.

Any suggestions, hints, tips or nudges towards helpful resources are greatly appreciated.

Apologies if this scenario was posted elsewhere, if it was then I was unable to locate it.

Cheers Guys!

  • 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-26T18:39:33+00:00Added an answer on May 26, 2026 at 6:39 pm

    I think what you are looking for here is really ‘how to store some info in a database’
    What database system?

    Check out
    http://www.datasprings.com/resources/articles-information/a-quick-guide-to-using-entity-framework

    You can easily use the entity framework to store that value in the database which is what I think your question was really about. I do agree with Bryanmac though, you should be storing the SID not the login name in case the name changes. If you know it will NEVER change then you could store the name, but since they can technically change in Windows, I’d be aware of this.
    If you have a specific question then on how to store that field using the Entity Framework, please post that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on asp.net MVC3 application and I have created a layout.cshtml which
I have a ASP.NET MVC3 application, which uses JSON to comunicate with a Flash
Using ASP.net MVC3 with C# I want to create a partial view that uses
I have an ASP.NET MVC3 project that uses a tab strip on certain pages.
With ASP.NET MVC3 (Razor) I have a simple page that loads a jQuery UI
i develop a asp.net mvc3 shop application which is multi tenant. Each customer (around
I am using ASP.NET MVC3 for my web application. To display a button in
I am working on ASP.NET MVC3. I have a partial view RestaurantAdminNavigation.ascx which i
I have this ASP.NET MVC3 code that's powered by Spring and Fluent NHibernate (NHIB
I am developing an ASP.NET MVC3 application with c# and Razor. I created a

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.