Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8934735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:51:15+00:00 2026-06-15T09:51:15+00:00

Hi guys I am trying to put a social share button to my article

  • 0

Hi guys I am trying to put a social share button to my article dynamically. I want to insert a social share script along with my article text into a database and display it with a unique share link.
so I am coding this way. This might not be a good idea but I would like to know if its possible this way.

string socialButton = "
<div id='social_nav_horizontal'>    <h3>        Bookmark or Share This Post</h3>    <ul>        <li>            <a class='delicious' href='http://del.icio.us/post?url=Your website title' title='Share this on del.icio.us'>Delicious</a></li>     <li>            <a class='facebook' href='http://www.facebook.com/sharer.php?u=http://yourwebsite.com'>Facebook</a></li>        <li>            <a class='stumbleupon' href='http://www.stumbleupon.com/submit? url=http://www.yoursite.com/'>Stumble</a></li>      <li>            <a class='twitter' href='http://twitter.com/home?status=Your Website Title- http://yourwebsite.com@TwitterUserName'>Twitter</a></li>    </ul></div><p>  &nbsp;</p>";

So “insert into myArticleTable (articleText) values (‘”+socialButton + articleText.Text+”‘)”;
But it throws an exception when trying to insert.

System.Data.OleDb.OleDbException: Syntax error (missing operator) in query expression ''

This work only if I directly past it to my ckeditor (wysiwyg) rich text editor and execute the insert statement on a button click event.

Can you help?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:51:16+00:00Added an answer on June 15, 2026 at 9:51 am

    Because a single quote is used for indicating the start and end of a string, you need to escape it. The short answer is to use two single quotes – ” – in order for a SQL database to store the value as ‘.

    Ex:-
    Insert into Person
    (First, Last)
    Values
    ('Joe', 'O''Brien')
    

    Look at using REPLACE to sanitize incoming values:

    • Oracle REPLACE
    • SQL Server
    • REPLACE MySQL
    • REPLACE PostgreSQL REPLACE

    You want to check for ””, and replace them if they exist in the string with ””” in order to escape the lone single quote.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi guys im trying to take the value of data(0) and put it into
Here's what I'm trying to do: I want to put away some methods into
Hi guys I'm trying to integrate the tinymce plugin however I'm running into problems
I'm trying to grab the sourcecode for Bro. If I put http://svn.icir.org/bro/trunk/bro/ into my
I am trying to to read each line from a text file and put
Hi guys i am trying to do this ContentValues initialValues = new ContentValues(); initialValues.put(monthlyBudget,account.monthlyBudge
Hey guys im trying to save the values into an textfile. I tried different
Good evening guys! I'm currently trying to put together a CloudFlare client for the
Hi guys i am trying to build a jni library. The build is working
Hi Guys i'm trying to let my Screen blink a morse code out using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.