Carl Thomas
8/19/2007 9:45:00 PM
Be'gorra. Since I'm starting ta be playin' with LINQ, can I assume that the
same considerations will be applyin' there?
Carl
"William Vaughn" <billvaNoSPAM@betav.com> wrote in message
news:u26snIv3HHA.5804@TK2MSFTNGP05.phx.gbl...
> Ah, no. You don't have to exclude all Irish surnames from your database.
> This was tried at various points in time in the past with disastrous
> consequences. The Replace approach forces you to simply repeat any single
> quote (apostrophe) to two single quotes just before it's concatenated into
> a SQL string. However, as we've discussed, this approach is full of other
> issues. The "parameter" approach deals with what I call the O'Malley issue
> as well as date formatting and other issues you might not have encountered
> yet.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant, Dad, Grandpa
> Microsoft MVP
> INETA Speaker
> www.betav.com
> www.betav.com/blog/billva
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
> __________________________________
> Visit www.hitchhikerguides.net to get more information on my latest book:
> Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
> and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
> -----------------------------------------------------------------------------------------------------------------------
>
> "Carl Thomas" <carlmthomas@windstream.net> wrote in message
> news:eYQb7au3HHA.4436@TK2MSFTNGP03.phx.gbl...
>>I assume by that you mean two apostrophes rather than a singlr quote.
>> OK - gotta remember that. But it means I have to go back into the old
>>database and change all the apostrophe-bearing words. I think I'll hold
>>onto the DataAdapter approach I'm using now which seems to work. I do
>>want to try the SqlParameter approach with an INSERT since I suspect it
>>may be a little faster. I'll kepp this in mind though. Thanx
>>
>> Carl
>>
>> "Tom Garth" <TomGarth@discussions.microsoft.com> wrote in message
>> news:2AE689D2-A743-46D4-BBAE-AC8B1B977857@microsoft.com...
>>> All that you have to do is double up on them. Sinding "O''Hare" will
>>> actually
>>> send "O'Hare".
>>> --
>>> Tom Garth
>>>
>>>
>>> "Carl Thomas" wrote:
>>>
>>>> I have names in a data collection the include apostrophes like O'Hare.
>>>> When
>>>> I use a simple VC#/ADO.NET approach with an SQL INSERT statement and
>>>> cmd.ExecuteNonQuery, it always hangs up on the apostrophe saying that
>>>> there
>>>> is an unterminated string. When I try using a DataAdapter and
>>>> SqlCommandBuilder, it says I need and INSERT statement, although it
>>>> will do
>>>> data without the apostrophes. Any idea how to handle these cases?
>>>> I've
>>>> also tried parameters, but the results are the same.
>>>>
>>>> TIA
>>>>
>>>> Carl
>>>>
>>>>
>>>>
>>
>>
>