19 messages in com.mysql.lists.dotnetRe: How to deal with the ' char| From | Sent On | Attachments |
|---|---|---|
| Jorge Bastos | 26 Feb 2005 04:55 | |
| Brandon Schenz | 26 Feb 2005 05:34 | |
| Jorge Bastos | 26 Feb 2005 05:37 | |
| Brandon Schenz | 26 Feb 2005 05:47 | |
| Jorge Bastos | 26 Feb 2005 05:56 | |
| Frank | 26 Feb 2005 06:03 | |
| James Moore | 26 Feb 2005 07:35 | |
| James Moore | 26 Feb 2005 07:47 | |
| Jordan Sparks | 26 Feb 2005 07:59 | |
| James Moore | 26 Feb 2005 08:40 | |
| Daniel Fisla | 26 Feb 2005 12:08 | |
| Jorge Bastos | 26 Feb 2005 12:30 | |
| Guy Platt | 28 Feb 2005 03:46 | |
| Kevin Turner | 28 Feb 2005 04:45 | |
| Reggie Burnett | 28 Feb 2005 06:37 | |
| mike...@mygenerationsoftware.com | 28 Feb 2005 07:05 | |
| Daniel Fisla | 01 Mar 2005 15:21 | |
| Reggie Burnett | 02 Mar 2005 04:56 | |
| Daniel Fisla | 02 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("'", " ") & "')"
Brandon Schenz http://www.schenzcustomdesigns.com
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




