﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	db_engine	os_version
1048	CT Throws an Error When the string in the Lookup Picker includes a hard bracket [ or ]	Martin Reisinger	Pete Cyr	"per Martin Bilek

We encountered an error while editing row in CuratorTool using LookupPicker. As you can see in enclosed picture, there is an unhandled exception in System.Data.LikeNode.AnalyzePattern. This error occurred only in case, when string include [ or ] character. I think, that error is in GRINGlobal.Client.Common.LookupTablePicker.RefreshList function in line:

_boundTable.DefaultView.RowFilter = rowFilter.Replace(""@displaymember + '%'"", ""'"" + ux_textboxFind.Text.Replace(""'"", ""''"") + ""%'"");
 
where I think, that you may replace ""["" with ""[[]"" and ""]"" with ""[]]"". 
 
Previous statements are running correctly, because on SQL I saw query:
 
exec sp_executesql N' SET FMTONLY OFF; SET NO_BROWSETABLE ON;SELECT TOP 1000 * FROM crop_trait_code_lookup WHERE crop_trait_id=''41469'' AND display_member like @displaymember + ''%'' ORDER BY display_member ASC',N'@displaymember nvarchar(4000)',@displaymember=N''
 
Something like this is discussed in http://stackoverflow.com/questions/8754120/getting-error-in-fetching-data-from-datatables-select-method-using-like-opera

...could be fixed by making the CT replace square brackets before using them in a LIKE operator.

"	defect	new	medium	Post 1.0	Curator Tool	1.9.6.41 CT			lookup picker		N/A	N/A
