Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
command = new OleDbCommand("SELECT uType FROM userAccount WHERE uName=? AND uPass=?", conString.con);
command.Parameters.AddWithValue("?", txtUsername.Text);
command.Parameters.AddWithValue("?", txtPassword.Text);
adapter.SelectCommand = command;
conn.conState();
OleDbDataReader reader = command.ExecuteReader();
if (reader.Read())
{
String uType;
uType = reader["uType"].ToString();

if (uType == "Admin")
{
mainForm mf = new mainForm();
mf.Show();
Hide();
}
else if (uType == "Billing")
{
BILLING bill = new BILLING();
bill.Show();
Hide();
}
Posted

1 solution

Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^]

There is even a warning how stringly people feel about this: Code based passwords[^]

Fixing that fixes your case sensitivity: the hash value for a lowercase string is not the same as that for a upper case string.
 
Share this answer
 
Comments
Richard MacCutchan 9-Sep-15 5:33am    
I often feel stringly. :)

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