How many names are you using here? You could create a static Dictionary in a Cache.cs file. Just update the dictionary when another user is created, this will take a load off the DB, so your Cache.cs would have the following:
private Dictionary<string,> _users = null;
public Dictionary<string,> Users
{
get
{
if (_users == null)
MethodThatPopulatesUsers();
return _users;
}
}
public void ClearUserCache()
{
_users = null;
}
private void MethodThatPopulatesUsers()
{
}
Then, where your textbox is, on the OnTextChanged event just have:
if (Cache.Users.ContainsKey(txtTextbox1.Text))
txtTextbox2.Text = Cache.Users[txtTextbox1.Text];