It is just some sort of standard. It was exact same way in ADO and it works
exact same way in a SQL statements. This is probably why Microsoft does not
mention it in documentation
--
Val Mazur
Microsoft MVP
"Sir Phillip Sydney" <(E-Mail Removed)> wrote in
message news

B68406D-3EE1-4672-9CE4-(E-Mail Removed)...
> Indeed it does. Thank you sir!
>
> Strange this isn't mentioned in the DataColumn.Expression Property
> documentation (at least, if it is, I can't find it) -- seems like pretty
> fundamental information. All the information about escaping seems to
> relate
> to how to escape wierd column names.
>
> Any doc-person at Microsoft listening?
>
> "Val Mazur" wrote:
>
>> Hi,
>>
>> You need to double it and it should work
>>
>> --
>> Val Mazur
>> Microsoft MVP
>>
>>
>> "Sir Phillip Sydney" <(E-Mail Removed)> wrote
>> in
>> message news:2933F6D1-223B-4AC4-A995-(E-Mail Removed)...
>> >I am adding data to a DateTable in a DataSet and need to verify if a row
>> > already exists with a specific column value:
>> >
>> > string aName = "O'Connor";
>> > string filter = "Name='" + aName + "'";
>> > DataRow [] drs = MyDataset.MyTable.Select(filter);
>> > if( drs.Length == 0 ) {
>> > // Add a row for this name
>> > }
>> >
>> > Note the name (O'Connor) contains a single quote.
>> >
>> > How should I escape the aName value so the filter works?
>> >
>> > Disclaimers:
>> > 1. This is a select on a DataTable not a database select -- so no
>> > parameterized queries.
>> > 2. The table MyDataset.MyTable already has a primary key on another
>> > field,
>> > so I can't do a MyTable.FindByXXX
>> >
>>
>>
>>