19 messages in com.mysql.lists.dotnetRe: How to deal with the ' char
FromSent OnAttachments
Jorge Bastos26 Feb 2005 04:55 
Brandon Schenz26 Feb 2005 05:34 
Jorge Bastos26 Feb 2005 05:37 
Brandon Schenz26 Feb 2005 05:47 
Jorge Bastos26 Feb 2005 05:56 
Frank26 Feb 2005 06:03 
James Moore26 Feb 2005 07:35 
James Moore26 Feb 2005 07:47 
Jordan Sparks26 Feb 2005 07:59 
James Moore26 Feb 2005 08:40 
Daniel Fisla26 Feb 2005 12:08 
Jorge Bastos26 Feb 2005 12:30 
Guy Platt28 Feb 2005 03:46 
Kevin Turner28 Feb 2005 04:45 
Reggie Burnett28 Feb 2005 06:37 
mike...@mygenerationsoftware.com28 Feb 2005 07:05 
Daniel Fisla01 Mar 2005 15:21 
Reggie Burnett02 Mar 2005 04:56 
Daniel Fisla02 Mar 2005 13:44 
Subject:Re: How to deal with the ' char
From:Brandon Schenz (bran@schenzcustomdesigns.com)
Date:02/26/2005 05:47:57 AM
List:com.mysql.lists.dotnet

Well, let's try that again.....

ok. Lets assume that the text box is named txtName. Our goal is to Replace the ' char with something else (I usual go with a space myself). In your code for the insert command go with something like this:

"insert into table values ('" & txtName.Text.Replace("'", " ") & "')"

Jorge Bastos wrote:

People,

I can i deal with this, imagine that i have a textbox for text, and someone
insert the text:

Maria Joana D'agua (D'agua it's a commun portuguese name)

in the sql statement i'll have:

"insert into table values ('Maria Joana D'agua')"

I'll have one ' in the midle wich i cannot have and mysql will generate an
error, How can this be solved? (I've thinked of a function to replace the ' char for
another char, but it'll have to be done for each textbox available in the form,
hop there's an easier way)

Jorge Bastos

------------------------------------------------------------------------

No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.5.0 - Release Date: 2/25/2005