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. Checking MAX() of a table in C#

Checking MAX() of a table in C#

Scheduled Pinned Locked Moved C#
csharpdatabasequestion
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.
  • B Offline
    B Offline
    Banjo Ayorinde
    wrote on last edited by
    #1

    Hi, I used sql 2005 as my backend. How do i check the MAX(of a field) in a table in from C# codes

    H A 2 Replies Last reply
    0
    • B Banjo Ayorinde

      Hi, I used sql 2005 as my backend. How do i check the MAX(of a field) in a table in from C# codes

      H Offline
      H Offline
      half life
      wrote on last edited by
      #2

      if one stores data in a DATATABLE it's easy to see that : DataTable DT; DT.Columns.Count;

      Have Fun Never forget it

      L 1 Reply Last reply
      0
      • B Banjo Ayorinde

        Hi, I used sql 2005 as my backend. How do i check the MAX(of a field) in a table in from C# codes

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        I think you want to get the max value of a column from a table in sql server? select max(column_name) from table You run this as an executescalar in your c# hope this helps

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • H half life

          if one stores data in a DATATABLE it's easy to see that : DataTable DT; DT.Columns.Count;

          Have Fun Never forget it

          L Offline
          L Offline
          leppie
          wrote on last edited by
          #4

          MAX not SUM.

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 alpha 4a out now (29 May 2008)

          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