Actually, I misspoke - I did try the parameter approach, but it didn't help.
Maybe I was using them wrong, but separating the read operations from one
database and the write operations into a second one through an intermediate
array worked. If it was slightly less elegent and complex, it worked. I'll
give the parametric approach another go to help trim the code a bit.
Carl
"Carl Thomas" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I haven't tried SqlParameters since I found a work around. I may give it a
>try since my solution was less elegent than I'd like (see my reply to Kerry
>Moorman's post). Somehow, I've never gotten around to SqlParameters, but
>it might be a nice application to try.
>
> Thanx.
>
> Carl
>
> "Morten Wennevik" <(E-Mail Removed)> wrote in message
> news
p.twwpsdsdklbvpo@ubuan...
>> On Sat, 11 Aug 2007 18:02:02 +0200, Carl Thomas
>> <(E-Mail Removed)> 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
>>>
>>>
>>>
>>
>> Carl, use SqlParameter to pass the data. Saves you all these kinds of
>> troubles.
>>
>> --
>> Happy coding!
>> Morten Wennevik [C# MVP]
>
>