Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Friend Im making an Application in this application all i want is value name to be display in different location when user is login.. so here is the deal . i want to show the Current AdminName who is Logged in IN the label so that i can do database updation like username update in basic of current user logged remove admin rights etc etc.. now im accessing the current admin Username like this i have Admin SettingPanel in which im taking current AdminName as below
C#
public void newname(string Admin)
        {

            adName.Text = Admin;
            AName.Text = Admin;

        } 
// this newname is getting the reference from another form here below
  public void FetchAdmin(string Admin)
        {
            
            label3.Text = Admin;
            adminsetter.newname(label3.Text);



        }

// the form name is adDashBoard where the value of Admin is Sucessfully displaying as Label3 as you can see above label 3 ... and this FetchAdmin is getting Reference from the AdminLogin form below:
C#
string Admin="";
        private void admin_Click(object sender, EventArgs e)
        {
            string username = AdName.Text;
            string  password = adPass.Text;
            td=edll.adlogin(username, password);

            Admin += username; 
            ad.FetchAdmin(Admin);
         
           
            if (td.Rows.Count>0)
            {
                MessageBox.Show("Login Successfull");
                this.Hide();
              
                ad.Show();

            }
        else { MessageBox.Show("Login Failed "); }

        }

now my problem is i want to show the username into the AdSettingPanel . but im not able to do that please help me... thankyou Guys you All are Awesome!! :)

What I have tried:

what i tired i have shown all above ... i have also same achieved via Properties but i dont want to create properties. i want to achieve it via simple variables
Posted
Updated 29-Apr-17 2:48am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900