I am using ES 2007 with C# ASP.NET and SQL Server 2005. I am having an issue with using the Collection.Filter() when the search value includes an ampersand. Could you give me any insight to why this is happening? My code is below (by the way, your Source Code entry window is not currently working). When roleName's value = "Stanley Supply & Services, Inc." no records are found, even though "Stanley Supply & Services, Inc." exists in the UserRole table and in the current UserRoleCollection.
public partial class UserRoleCollection : esUserRoleCollection
{ ....
public UserRole FindByName(string roleName)
{
UserRole foundRole = null;
this.Filter = String.Format("{0} = '{1}'", UserRoleMetadata.ColumnNames.RoleName, roleName);
if (this.Count == 1)
{
foundRole = this[0];
}
this.Filter = String.Empty;
return foundRole;
}
... }
chuck foster
.net/sql server developer