I have a table in SQL Server 2008 with uniqueidentifier
field.
In my application (C#, WPF) I have a textbox which intended for search some data by GUID, user can enter guid by typing, ctrl+v, etc, so he/she can make an error.
What is the best and fastest approach to make a search by this field using linq2sql ignoring whitespaces, "-"... any other characters?
var d = from status in dc.FolderStatus.Where(status => status.Date <= DateTime.Now
&& status.Folder.TapeCode.ToString().Replace("-", "") == tapeCode.ToUpper().Replace("-", "").Replace(" ", "")
)
TapeCode
is uniqueidentifier
in SQL Server 2008 and Guid in dbml file. Is it ok?