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. How to update only one row in database?

How to update only one row in database?

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestionannouncement
4 Posts 3 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.
  • S Offline
    S Offline
    sinanju
    wrote on last edited by
    #1

    I am displaying the data in datagrid from a table, now there is a column of 'availableAmount'. Now the user can insert more amount. So how to get this top row get updated. -- modified at 1:34 Thursday 16th March, 2006

    K 1 Reply Last reply
    0
    • S sinanju

      I am displaying the data in datagrid from a table, now there is a column of 'availableAmount'. Now the user can insert more amount. So how to get this top row get updated. -- modified at 1:34 Thursday 16th March, 2006

      K Offline
      K Offline
      kirthikirthi
      wrote on last edited by
      #2

      In datagrid set the column's readonly to true asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 3:25 Thursday 16th March, 2006

      S 1 Reply Last reply
      0
      • K kirthikirthi

        In datagrid set the column's readonly to true asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -- modified at 3:25 Thursday 16th March, 2006

        S Offline
        S Offline
        sinanju
        wrote on last edited by
        #3

        I think, I have made the question mix up. My question should be for SQL forum. Just forget about datagrid, and let me know, what might be the sql query for updating the top row in table sorted by date descending. Thanks for the reply.

        V 1 Reply Last reply
        0
        • S sinanju

          I think, I have made the question mix up. My question should be for SQL forum. Just forget about datagrid, and let me know, what might be the sql query for updating the top row in table sorted by date descending. Thanks for the reply.

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #4

          you're mixing up your sql I think. Updating the row goes via an UPDATE statement. Ordering your table is impossible, you need to use a SELECT statement (which will result in a view of the table, it isn't the table itself). UPDATE SET = VALUE WHERE (don't forget the quotes if it is a string. SELECT < COLUMNS > FROM WHERE ORDER BY DESC where < COLUMNS > is a kommaseperated list of the columns you want in your view or a * to select them all. This should be clear, if it isn't I suggest you learn sql first, your going to need it and this is basic stuff. Good luck! No hurries, no worries. -- modified at 4:04 Thursday 16th March, 2006

          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