Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm writing code in C# and I need to have the username of the current user as stored in a software database table against which users must authenticate before logging in .

I've tried
Environment.Username but what this does is take the currently logged in Windows OS User.

What I have tried:

comboBox1.enabled= false;
comboBox1.Text = Environment. Username.ToString ();
Posted
Updated 28-Oct-16 15:24pm

1 solution

Try SELECT CURRENT_USER.

The current Windows user may be different from the current SQLite user.
 
Share this answer
 
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