Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. error in insert 'msman88'

error in insert 'msman88'

Scheduled Pinned Locked Moved C#
help
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abdul Rhman Alsri
    wrote on last edited by
    #1

    Error in insert string a = "'msman88'"; Needed to be inserted as 'msman88' Error : Incorrect syntax near 'msman88'. Line 70: cmd_Account.ExecuteNonQuery();

    A L 2 Replies Last reply
    0
    • A Abdul Rhman Alsri

      Error in insert string a = "'msman88'"; Needed to be inserted as 'msman88' Error : Incorrect syntax near 'msman88'. Line 70: cmd_Account.ExecuteNonQuery();

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      in SQL single quote's can be used to delimit string literals, so if you need them as part of your data, try one of the following: 1. use SQLParameter, which is always the better option as it prevents SQL Injection vulnerability; 2. or double the single quote(s) inside your data Now why would you want single quotes at the extremes of your data in the first place? Maybe you are misinterpreting some piece of documentation? :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]


      Prolific encyclopedia fixture proof-reader browser patron addict?
      We all depend on the beast below.


      1 Reply Last reply
      0
      • A Abdul Rhman Alsri

        Error in insert string a = "'msman88'"; Needed to be inserted as 'msman88' Error : Incorrect syntax near 'msman88'. Line 70: cmd_Account.ExecuteNonQuery();

        A Offline
        A Offline
        Abhinav S
        wrote on last edited by
        #3

        Abdul-Rhman Alsri wrote:

        string a = "'msman88'";

        Try string a = @"''msman88''".

        modified on Saturday, May 1, 2010 11:22 PM

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups