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. Web Development
  3. ASP.NET
  4. what is wrong here? Please help

what is wrong here? Please help

Scheduled Pinned Locked Moved ASP.NET
helpquestionannouncementcareer
5 Posts 4 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.
  • M Offline
    M Offline
    minniemooo
    wrote on last edited by
    #1

    Hi, I am getting the following error: Line 1: Incorrect syntax near ','. conn.Execute = "UPDATE JOB SET " &_ "TITLE='" & cleanText(sTitle) & "', " &_ "CATEGORY=" & cleanText(sCategory) & ", " &_ "DEPARTMENT='" & cleanText(sDepartment) & "', " &_ "DESCRIPTION='" & cleanText(sDescription) & "', " &_ "RESPONSIBILITIES='" & cleanText(sResponsibility) & "', " &_ "REQ='" & cleanText(sRequirements) & "', " &_ "COMPENSATION='" & cleanText(sCompensation) & "', " &_ "CONTACT_PERSON='" & cleanText(sContactPerson) & "', " &_ "CLOSINGDATE='" & cleanText(sClosingDate) & "', " &_ "CONTACT_EMAIL='" & cleanText(sContactEmail) & "', " &_ "StatusId='" & 0 & "' WHERE ID=" & jobID

    D G S 3 Replies Last reply
    0
    • M minniemooo

      Hi, I am getting the following error: Line 1: Incorrect syntax near ','. conn.Execute = "UPDATE JOB SET " &_ "TITLE='" & cleanText(sTitle) & "', " &_ "CATEGORY=" & cleanText(sCategory) & ", " &_ "DEPARTMENT='" & cleanText(sDepartment) & "', " &_ "DESCRIPTION='" & cleanText(sDescription) & "', " &_ "RESPONSIBILITIES='" & cleanText(sResponsibility) & "', " &_ "REQ='" & cleanText(sRequirements) & "', " &_ "COMPENSATION='" & cleanText(sCompensation) & "', " &_ "CONTACT_PERSON='" & cleanText(sContactPerson) & "', " &_ "CLOSINGDATE='" & cleanText(sClosingDate) & "', " &_ "CONTACT_EMAIL='" & cleanText(sContactEmail) & "', " &_ "StatusId='" & 0 & "' WHERE ID=" & jobID

      D Offline
      D Offline
      deepaks3
      wrote on last edited by
      #2

      .execute is a function not a property whihc can be assinged a values... it should be conn.Execute("your query"); and i guess the ";" is also missing

      Deepak Surana

      G 1 Reply Last reply
      0
      • M minniemooo

        Hi, I am getting the following error: Line 1: Incorrect syntax near ','. conn.Execute = "UPDATE JOB SET " &_ "TITLE='" & cleanText(sTitle) & "', " &_ "CATEGORY=" & cleanText(sCategory) & ", " &_ "DEPARTMENT='" & cleanText(sDepartment) & "', " &_ "DESCRIPTION='" & cleanText(sDescription) & "', " &_ "RESPONSIBILITIES='" & cleanText(sResponsibility) & "', " &_ "REQ='" & cleanText(sRequirements) & "', " &_ "COMPENSATION='" & cleanText(sCompensation) & "', " &_ "CONTACT_PERSON='" & cleanText(sContactPerson) & "', " &_ "CLOSINGDATE='" & cleanText(sClosingDate) & "', " &_ "CONTACT_EMAIL='" & cleanText(sContactEmail) & "', " &_ "StatusId='" & 0 & "' WHERE ID=" & jobID

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        What kind of object is conn? There is no built-in class that has a property named Execute, is it a class of your own? Does setting the property execute the query? What data type is the field CATEGORY? Shouldn't there be apostrophes around the value? What does the cleanText method do? Does it encode the strings properly to be inserted as string literals in an SQL query? What kind of database are you using?

        --- single minded; short sighted; long gone;

        1 Reply Last reply
        0
        • D deepaks3

          .execute is a function not a property whihc can be assinged a values... it should be conn.Execute("your query"); and i guess the ";" is also missing

          Deepak Surana

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          deepaks3 wrote:

          and i guess the ";" is also missing

          It's VB code.

          --- single minded; short sighted; long gone;

          1 Reply Last reply
          0
          • M minniemooo

            Hi, I am getting the following error: Line 1: Incorrect syntax near ','. conn.Execute = "UPDATE JOB SET " &_ "TITLE='" & cleanText(sTitle) & "', " &_ "CATEGORY=" & cleanText(sCategory) & ", " &_ "DEPARTMENT='" & cleanText(sDepartment) & "', " &_ "DESCRIPTION='" & cleanText(sDescription) & "', " &_ "RESPONSIBILITIES='" & cleanText(sResponsibility) & "', " &_ "REQ='" & cleanText(sRequirements) & "', " &_ "COMPENSATION='" & cleanText(sCompensation) & "', " &_ "CONTACT_PERSON='" & cleanText(sContactPerson) & "', " &_ "CLOSINGDATE='" & cleanText(sClosingDate) & "', " &_ "CONTACT_EMAIL='" & cleanText(sContactEmail) & "', " &_ "StatusId='" & 0 & "' WHERE ID=" & jobID

            S Offline
            S Offline
            Sylvester george
            wrote on last edited by
            #5

            here the syntax is correct but when you inject the values there migt be some special characters , or '..So sql injection is little dangerous in codeing any time it will break...Better write stored procedure and call it in the front end. All the best

            Regards, Sylvester G Senior Software Engineer Xoriant Solutions sylvester_g_m@yahoo.com Score it if you like my post

            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