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. Database & SysAdmin
  3. Database
  4. quick newline question for a noob

quick newline question for a noob

Scheduled Pinned Locked Moved Database
databasequestioncsharphelptutorial
3 Posts 1 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.
  • L Offline
    L Offline
    likefood
    wrote on last edited by
    #1

    I'm starting out with database programming in C# (using System.Data.Odbc). I have an SQL command, using the UPDATE command. I'm trying to update a memo field (in an .mdb file) with contents that have multiple lines of text. However, I keep getting an error. I can see what the error is saying (that it doesn't like me starting a line without an SQL command). How do I modify the following example so that it will work? UPDATE mytable SET pagecontents = 'first line of text second line of text third line of text' WHERE id = 3 The error basically says: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression "second line of text thirdline of text'

    -Daniel Typing too fast fro my owngood

    L 1 Reply Last reply
    0
    • L likefood

      I'm starting out with database programming in C# (using System.Data.Odbc). I have an SQL command, using the UPDATE command. I'm trying to update a memo field (in an .mdb file) with contents that have multiple lines of text. However, I keep getting an error. I can see what the error is saying (that it doesn't like me starting a line without an SQL command). How do I modify the following example so that it will work? UPDATE mytable SET pagecontents = 'first line of text second line of text third line of text' WHERE id = 3 The error basically says: ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression "second line of text thirdline of text'

      -Daniel Typing too fast fro my owngood

      L Offline
      L Offline
      likefood
      wrote on last edited by
      #2

      Basically, I need to find out how to put multiple lines of text into a memo field. The text may or may not have apostrophes, quotes, backslashes, and other characters that usually require special treatment in other circumstances. Anyone?

      -Daniel Typing too fast fro my owngood

      L 1 Reply Last reply
      0
      • L likefood

        Basically, I need to find out how to put multiple lines of text into a memo field. The text may or may not have apostrophes, quotes, backslashes, and other characters that usually require special treatment in other circumstances. Anyone?

        -Daniel Typing too fast fro my owngood

        L Offline
        L Offline
        likefood
        wrote on last edited by
        #3

        Nevermind, I found it myself. I'm using an OdbcCommand object with an OdbcParameter.

        -Daniel Typing too fast fro my owngood

        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