Re: What Did I Miss Here?
From: Jared (_at_vb_newsgroups@hotmail.com)
Date: 09/11/04
- Previous message: Michael D. Long: "Re: Looking For Driver"
- In reply to: Wayne Wengert: "Re: What Did I Miss Here?"
- Next in thread: Wayne Wengert: "Re: What Did I Miss Here?"
- Reply: Wayne Wengert: "Re: What Did I Miss Here?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 11 Sep 2004 14:15:26 -0500
Is the Use Quoted Identifiers option checked in your database property sheet
under the Options tab?
"Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
news:O4IcLHDmEHA.2412@TK2MSFTNGP10.phx.gbl...
> In the database it is being stored as two single quotes. I've verified
> that
> I really am typing two single quotes and when I run your sample in QA it
> works as expected (it's a boy it's a girl)
>
> I've used this replace method many times in ASP and it has always worked
> fine. I am wondering if there is something special in .NET?
>
> Wayne
>
> "Jared" <@vb_newsgroups@hotmail.com> wrote in message
> news:10k6fgrthqggp00@corp.supernews.com...
>> In the database is it stored with two single quotes '' or one double
>> quote
>> "? Could you have mistyped the replacement string? All the documentation
>> I've found supports your method. Could it have something to do with your
>> colation?
>> If you paste this block into query analyzer what does it produce?
>>
>> CREATE TABLE #MyTable (
>> Col1 varchar(25),
>> Col2 varchar(25))
>>
>> INSERT INTO #MyTable VALUES('it''s a boy', 'it''s a girl')
>> SELECT * FROM #MyTable
>> DROP TABLE #MyTable
>>
>> "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
>> news:uqdTa4BmEHA.324@TK2MSFTNGP11.phx.gbl...
>> > Jared;
>> >
>> > Thanks for the reply. If I don't use the replace function the sql
>> > statement
>> > blows up!
>> >
>> > Wayne
>> >
>> > "Jared" <@vb_newsgroups@hotmail.com> wrote in message
>> > news:10k67te4rs5ku66@corp.supernews.com...
>> >> Have you tried to execute your function without replacing your quotes?
>> > Does
>> >> it produce the results you want? Is possible that your dataadapter or
>> >> whatever you are using escapes this char for you? I know the
> xmldocument
>> >> object does this intrinsically.
>> >>
>> >> obj.innerText = "Amos & Andrew"
>> >> - Produces -
>> >> <obj>Amos & Andrew</obj>
>> >>
>> >>
>> >> "Wayne Wengert" <wayneDONTWANTSPAM@wengert.com> wrote in message
>> >> news:eO3j0OBmEHA.712@TK2MSFTNGP09.phx.gbl...
>> >> >I am using VB.NET connected to an SQL 2000 server and I want to save
>> >> >some
>> >> > text fields from a form to string fields in a table. The text might
>> >> > include
>> >> > some single quotes so in my update command I am replacing single
> quotes
>> >> > with
>> >> > two single quotes so that the update query works. (see piece of
>> > statement
>> >> > below)
>> >> >
>> >> > My problem is that when I look at what really gets stored in the
> table,
>> >> > all
>> >> > single quotes are now doubled such as:
>> >> >
>> >> > Text Value = Joe's
>> >> > Stored in table = Joe''s
>> >> >
>> >> > What am I missing here?
>> >> >
>> >> >
>> >> > ============ Segment of SQL statement =============
>> >> >
>> >> >
>> >> > Update UnitShowInfo Set ShowName = '" & Replace(txtShowName.Text,
> "'",
>> >> > "''")
>> >> > & "',.....
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>
- Previous message: Michael D. Long: "Re: Looking For Driver"
- In reply to: Wayne Wengert: "Re: What Did I Miss Here?"
- Next in thread: Wayne Wengert: "Re: What Did I Miss Here?"
- Reply: Wayne Wengert: "Re: What Did I Miss Here?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|