Gregory3
asked on
Where Query Syntax Help in C# Code Behind
Hope this is an easy one. I have a combobox in silverlight that is querying from a database service with a where clause. The data has commas so it works when using the single quotes, but I can't figure out the query code in C# to get the single quotes to work.
This works outside of Visual Studio
(MBR_112th = 'LastName, FirstName MiddleInitial.')
This works outside of Visual Studio
(MBR_112th = 'LastName, FirstName MiddleInitial.')
queryName.OutFields.AddRange(new string[] { "MBR_112TH", "DIST", "WEBSITE", "PERSONAL_WEBSITE" });
queryName.Where = "MBR_112TH = " + QueryComboBoxName.SelectedIndex.ToString();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys. Both worked in different situations.
I forgot an opening parentheses on the function call. Corrected below:
Open in new window