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. SQL SELECT statement problem in TableAdapter configuration wizard C#.

SQL SELECT statement problem in TableAdapter configuration wizard C#.

Scheduled Pinned Locked Moved C#
csharpdatabasehelpasp-nettutorial
2 Posts 2 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
    antony_t
    wrote on last edited by
    #1

    Hi so im following a tutorial http://www.asp.net/learn/data-access/tutorial-01-cs.aspx. I'm trying to configure a TableAdapter Query in the configuration Wizard with a SELECT statement which has a WHERE clause at the end. I am about half way down the tutorial and have followed it word for word. I have entered: SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued FROM Products WHERE CategoryID = @CategoryID But i am getting an error message on the last page of the config wizard saying: Generated SELECT statement. Error in WHERE clause near ‘@’. Unable to parse query text. Can anyone hazard a guess at what i'm doing wrong???:mad:

    T 1 Reply Last reply
    0
    • A antony_t

      Hi so im following a tutorial http://www.asp.net/learn/data-access/tutorial-01-cs.aspx. I'm trying to configure a TableAdapter Query in the configuration Wizard with a SELECT statement which has a WHERE clause at the end. I am about half way down the tutorial and have followed it word for word. I have entered: SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued FROM Products WHERE CategoryID = @CategoryID But i am getting an error message on the last page of the config wizard saying: Generated SELECT statement. Error in WHERE clause near ‘@’. Unable to parse query text. Can anyone hazard a guess at what i'm doing wrong???:mad:

      T Offline
      T Offline
      TJoe
      wrote on last edited by
      #2

      If you replace "@CategoryID" with "?" (without the quotes), does it work?

      Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

      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