You'll have to provide both firstname and lastname enable to get accurate results, that's the default behavior of 'Search by Name'. You could enhance that by changing the line below.
From:
Code:
public void btnSearchForName_Click(object sender, EventArgs e)
{
string sql = "select top 1 CustomerID,GiftRegistryGUID from Customer where ltrim(rtrim(lower(FirstName + ' ' + LastName))) like '%" + DB.SQuote(txtSearchForName.Text.ToLowerInvariant()) + "%' and GiftRegistryIsAnonymous=0 and ShippingAddressID IS NOT NULL and ShippingAddressID<>0 and GiftRegistryAllowSearchByOthers=1";
DoSearch(sql);
}
to:
Code:
string sql = "select top 1 CustomerID,GiftRegistryGUID from Customer where ltrim(rtrim(lower(FirstName + ' ' + LastName))) like " + DB.SQuote( "%" + txtSearchForName.Text.ToLowerInvariant() "%" + )" and GiftRegistryIsAnonymous=0 and ShippingAddressID IS NOT NULL and ShippingAddressID<>0 and GiftRegistryAllowSearchByOthers=1";
* just change the red line above with this one.