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 Value to String

SQL Select Value to String

Scheduled Pinned Locked Moved C#
questiondatabase
4 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.
  • H Offline
    H Offline
    hobbsieoz
    wrote on last edited by
    #1

    This is probably a really easy question, but i need to select a value from an SQL table and put it in a string. The table - PRODUCTS, has a column called QTY and a column called ID I need to select the QTY value where ID = x. How do i select the single value and put it into a string?

    S 1 Reply Last reply
    0
    • H hobbsieoz

      This is probably a really easy question, but i need to select a value from an SQL table and put it in a string. The table - PRODUCTS, has a column called QTY and a column called ID I need to select the QTY value where ID = x. How do i select the single value and put it into a string?

      S Offline
      S Offline
      selcuks
      wrote on last edited by
      #2

      I am not sure if what you have asked is this simple but: How about building an SqlCommand (System.Data.SqlClient.SqlCommand or SqlCommandBuilder) SELECT QTY FROM PRODUCTS WHERE ID = 'x' You may need to search through MSDN to learn how to use these classes.

      Always keep the Murphy Rules in mind!

      H 1 Reply Last reply
      0
      • S selcuks

        I am not sure if what you have asked is this simple but: How about building an SqlCommand (System.Data.SqlClient.SqlCommand or SqlCommandBuilder) SELECT QTY FROM PRODUCTS WHERE ID = 'x' You may need to search through MSDN to learn how to use these classes.

        Always keep the Murphy Rules in mind!

        H Offline
        H Offline
        hobbsieoz
        wrote on last edited by
        #3

        Ok. How do i get the result into a string?

        H 1 Reply Last reply
        0
        • H hobbsieoz

          Ok. How do i get the result into a string?

          H Offline
          H Offline
          hobbsieoz
          wrote on last edited by
          #4

          Can anybdoy help?

          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