maitopoika
August 27th, 2009, 11:43 AM
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?
private void UserRedirect(string UserType)
{
string AdminString = "Admin";
bool b = AdminString == UserType;
LBLError.Text = b.ToString() + AdminString+UserType;
}
the output to the label here is
False Admin Admin
not sure why it is saying false when they look the same
here is where i am calling this function
....
loginType = myEmployee.loginType; //i have confirmed that this is "Admin"
UserRedirect(loginType);
any help would be great. thanks!
I keep getting a false when they strings look the same, they are both "Admin"
can you see what I am doing wrong?
private void UserRedirect(string UserType)
{
string AdminString = "Admin";
bool b = AdminString == UserType;
LBLError.Text = b.ToString() + AdminString+UserType;
}
the output to the label here is
False Admin Admin
not sure why it is saying false when they look the same
here is where i am calling this function
....
loginType = myEmployee.loginType; //i have confirmed that this is "Admin"
UserRedirect(loginType);
any help would be great. thanks!