So i am trying to compare a string from a DB to another string that i code in.
I keep getting a false when they strings look the same, they are both "Admin"
can you see what I am doing wrong?
the output to the label here isCode:private void UserRedirect(string UserType) { string AdminString = "Admin"; bool b = AdminString == UserType; LBLError.Text = b.ToString() + AdminString+UserType; }
False Admin Admin
not sure why it is saying false when they look the same
here is where i am calling this function
any help would be great. thanks!Code:.... loginType = myEmployee.loginType; //i have confirmed that this is "Admin" UserRedirect(loginType);


Reply With Quote