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. bind dates in datagrid in mm/dd/yyyy format..........,

bind dates in datagrid in mm/dd/yyyy format..........,

Scheduled Pinned Locked Moved ASP.NET
wpfwcftutorial
6 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
    Member 3879881
    wrote on last edited by
    #1

    Hi in my datagrid i am binding the dates in one bound column..., Its display like mm/dd/yyyy 12:00:00 AM........,(7/1/2007 12:00:00 AM) But i like to show only mm/dd/yyyy only...,(7/1/2007) How to display like that...,

    Regards, Magi

    G I 2 Replies Last reply
    0
    • M Member 3879881

      Hi in my datagrid i am binding the dates in one bound column..., Its display like mm/dd/yyyy 12:00:00 AM........,(7/1/2007 12:00:00 AM) But i like to show only mm/dd/yyyy only...,(7/1/2007) How to display like that...,

      Regards, Magi

      G Offline
      G Offline
      gauthee
      wrote on last edited by
      #2

      assuming your are using sql server 2000 as database, in your select query write: convert(varchar, date_column_name, 101) this is one way!

      Gautham

      M 1 Reply Last reply
      0
      • M Member 3879881

        Hi in my datagrid i am binding the dates in one bound column..., Its display like mm/dd/yyyy 12:00:00 AM........,(7/1/2007 12:00:00 AM) But i like to show only mm/dd/yyyy only...,(7/1/2007) How to display like that...,

        Regards, Magi

        I Offline
        I Offline
        Imran Khan Pathan
        wrote on last edited by
        #3

        Use <%# Eval("dateField","mm/dd/yyyy")%> In ItemTemplate Best regard Pathan

        GOD HELP THOSE WHO HELP THEMSELVES

        M 1 Reply Last reply
        0
        • G gauthee

          assuming your are using sql server 2000 as database, in your select query write: convert(varchar, date_column_name, 101) this is one way!

          Gautham

          M Offline
          M Offline
          Member 3879881
          wrote on last edited by
          #4

          Ya but what's that after column name y should want to give "101" ??????

          Regards, Magi

          G 1 Reply Last reply
          0
          • M Member 3879881

            Ya but what's that after column name y should want to give "101" ??????

            Regards, Magi

            G Offline
            G Offline
            gauthee
            wrote on last edited by
            #5

            These are predefined formats to handle datetime values, for more info you can to your books online and in the index search press convert

            Gautham

            1 Reply Last reply
            0
            • I Imran Khan Pathan

              Use <%# Eval("dateField","mm/dd/yyyy")%> In ItemTemplate Best regard Pathan

              GOD HELP THOSE WHO HELP THEMSELVES

              M Offline
              M Offline
              Muhammad Waqas Butt
              wrote on last edited by
              #6

              How to change Datagrid Header Text through programming in C#.net. and how to set colunm width and height. How to format date in datagrid column. I'm using MS Access 2003 and i database date save in this format(7/11/2007) and I want to highlight row where cell fee value = 0;

              |Muhamad Waqas Butt| waqasb4all@yahoo.com www.sktech.freewebspace.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