Article View: be.comp.programming
Article #3694Re: hoe kunde in asp.net ' en " laten invoegen in een textbox
From: Andries
Date: Tue, 11 Nov 2003 11:16
Date: Tue, 11 Nov 2003 11:16
19 lines
1808 bytes
1808 bytes
"Wim Poorten" <invalid@nohost.com> schreef in bericht
news:ar2sb.1578$GO.50884717@hestia.telenet-ops.be...
> Er zijn verschillende mogelijkheden:
>
> 1) vervang alle quotes door dubbele quotes:
> Invoer=Invoer.Replace("'","''")
> Invoer=Invoer.Replace("""","""""")
>
> 2) gebruik een OleDbCommand of SqlCommand met parameters.
> Dim cm As New OleDbCommand("INSERT INTO tabel (inhoud) VALUES
(?)",conn)
> cm.Parameters.Add("@inhoud", Invoer)
>
> Deze laatste oplossing heeft ook nog bijkomende voordelen in verband
> met beveiliging (tegenhouden van kwaadaardige sql-opdrachten in een
> invoervak).
okay bedankt voor deze info
dit is inderdaad hetgeen ik zocht
Technical Details
Message-ID:
<Yx3sb.17739$dQ5.595046@phobos.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!transit.news.xs4all.nl!skynet.be!skynet.be!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<Dxyrb.14777$He5.556162@phobos.telenet-ops.be> <ar2sb.1578$GO.50884717@hestia.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,172ef532ca261c19 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-11-11 03:16:09 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!transit.news.xs4all.nl!skynet.be!skynet.be!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: "Andries" <andries.tacq@pandora.be> Newsgroups: be.comp.programming References: <Dxyrb.14777$He5.556162@phobos.telenet-ops.be> <ar2sb.1578$GO.50884717@hestia.telenet-ops.be> Subject: Re: hoe kunde in asp.net ' en " laten invoegen in een textbox Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.0 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Message-ID: <Yx3sb.17739$dQ5.595046@phobos.telenet-ops.be> Date: Tue, 11 Nov 2003 11:16:08 GMT NNTP-Posting-Host: 213.118.25.124 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1068549368 213.118.25.124 (Tue, 11 Nov 2003 12:16:08 MET) NNTP-Posting-Date: Tue, 11 Nov 2003 12:16:08 MET Organization: Telenet Internet