You are trying to override the label with a string value, which results in type mismatch and actually is not what you've intended. You have to access UIInput
property value
or defaultValue
if you wan't to provide defaults for user - anyway according to your code you probably don't want it.
Anyway, if you are using the latest NGUI, you should correct your code like this:
UIInput username = GameObject.Find ("tb_username").GetComponent <UIInput> ();
UIInput password = GameObject.Find ("tb_password").GetComponent <UIInput> ();
if( username != null )
username.value = DB.getName(LoginSystem.userNameStatic);
if( password != null )
password.value = DB.getPassword ("password");
That should work if you correctly find objects with these names you specify, otherwise it won't do anything.