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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:39:20+00:00 2026-05-27T21:39:20+00:00

Can someone perhaps help me with a little problem I have on my database

  • 0

Can someone perhaps help me with a little problem I have on my database application.

When a user logs into my database with a User Name and Password, I want the User Name to be stored and accesible by the application as a whole (all forms etc), so that every action undertaken carries the users signature as it were.

I’m thinking the code is probably something like the following:

namespace YourNamespaceName
{
    class Variables
    {
        public static string strUser = "user name";
    }
}

Which I can recall then with Variables.strUser

However I don’t want to hard code the value of user name into my application. Rather I need it to be evaluated at runtime based on the initial log in procedure, and retain the user name for reference for the duration of the application running.

Thanking you all in anticipation of your assistance.

  • 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-27T21:39:20+00:00Added an answer on May 27, 2026 at 9:39 pm
    namespace YourNamespaceName
    {
        public static class Variables
        {
            private static string strUser;
    
    
            public static string User {
               get { return strUser; }
               set { strUser = value; }
            }
        }
    }
    

    You didn’t specify framework version, but this code works with .NET 2.0. To use:

    Variables.User = "User name";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so perhaps someone can help me with a problem I'm trying to solve.
I wonder whether someone can help me please. I have a mySQL database which
Perhaps someone can help me out with this one: I'm using a basic search
An odd error here, perhaps someone can help track down source as it's attempting
Perhaps I'm having a Post-Ballmer-Peak Moment . I'm hoping that someone can help point
Perhaps someone can help me out here. I'm writing a program in C# to
This is not technically a programming question but perhaps someone can help me. Yes,
Perhaps someone can point me in the correct direction, because I'm completely stumped on
I'm not sure what this practice is actually called, so perhaps someone can edit
I wonder whether someone can help me please. I've put together this page, which

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.