rantorofnae

Subtitle

Blog

Replace single quote in sql string

Posted by [email protected] on

Join the world’s largest interactive community dedicated to Oracle technologies.


You can't delete other posts. NET application, then you'd use the to feed the SqlCommand parameters for the query and all of this single quote business will be taken care of automatically. You can't send emails. Do you want this?


replace single quote in sql string

There are a few places where the single quote isn't followed by space. Replace Strip ,'''','' was not working because the single quote was ascii character 146 instead of 39.


replace single quote in sql string

Join the world’s largest interactive community dedicated to Oracle technologies. - This is usually the preferred method as SQL parameters will also help prevent attacks.


replace single quote in sql string

How to insert a string value with an apostrophe single quote in a column is a general problem? Mostly, it happens when you insert any name with apostrophe. One of my colleagues faced this issue this morning. He had to upload a list of customers and some of the customers had apostrophe in the name and he was getting error during insertion. After a while, he emailed me stating he fixed it. So I inquired him how he did it and I received a very interesting reply, he said he copied the name then opened the table and pasted it ;. Never try this method. Lets now resolve it step by step. Step 1 : Create a sample table. This step is just to demonstrate the error. Step 3 : Just replace the single apostrophe with double apostrophe and insert the record again. Conclusion : Remember, whenever you come across such cases, just replace apostrophe single quote with double apostrophe double quotes and it works fine. Comments left by any independent reader are the sole responsibility of that person. Should you identify any content that is harmful, malicious, sensitive or unnecessary, please contact me via email imran raresql.

Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

0 Comments