by Brad
30. October 2007 09:48
Here is a typical select filter string that you might perform on a DataTable:
clients.Select(string.Format(" DisplayName = '{0}' ", ClientName));
However if ClientName in the above example contains an apostrophe the select will fail. A simple fix is to the use following code to escape it:
ClientName.Replace("'","''")
Which replaces a single apostrophe with two.
c8e409dc-0692-4f3c-9913-6f05ab58dbf7|0|.0
Tags:
C#