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. is this query correct?

is this query correct?

Scheduled Pinned Locked Moved ASP.NET
questiondatabasehelp
4 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
    M Ambigai
    wrote on last edited by
    #1

    is this query correct? "INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')"; error is Incorrect syntax near the keyword 'Create'

    L C J 3 Replies Last reply
    0
    • M M Ambigai

      is this query correct? "INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')"; error is Incorrect syntax near the keyword 'Create'

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...) is the synatax from w3schools.com[^] is Create your table name? try putting insert into `create` (...) values(...) example

      INSERT INTO `Persons` (P_Id, LastName, FirstName)
      VALUES (5, 'Tjessem', 'Jakob')

      1 Reply Last reply
      0
      • M M Ambigai

        is this query correct? "INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')"; error is Incorrect syntax near the keyword 'Create'

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        What is name, city, etc ? Where do they come from ? It looks to me like your database security is a nightmare.

        Christian Graus Driven to the arms of OSX by Vista.

        1 Reply Last reply
        0
        • M M Ambigai

          is this query correct? "INSERT INTO Create(names,city,state,email,username,pword,securityq,answer) VALUES('" + name + "','" + city + "','" + state + "','" + email + "','" + user + "','" + pswd + "','" + question + "','" + ans + "')"; error is Incorrect syntax near the keyword 'Create'

          J Offline
          J Offline
          jceresini
          wrote on last edited by
          #4

          "Create" is a reserved word in MSSQL so it cannot be used as the name of a table. Here is a full list of reserved words: http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx[^] You should be able to insert into the table by quoting the table name like so: INSERT INTO "Create" ... Joe Ceresini Network Engineer jceresini@hostmysite.com Hostmysite.com

          modified on Monday, February 2, 2009 7:10 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