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. Database & SysAdmin
  3. Database
  4. Dispalying a blank instead of null.

Dispalying a blank instead of null.

Scheduled Pinned Locked Moved Database
cssdatabasehelpquestion
5 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.
  • M Offline
    M Offline
    minkinin
    wrote on last edited by
    #1

    Hi all. 1.pls help,I want to display a blank column on the grid when my field is null in the DB instead of NULL,and when theres a value the grid should display that value. 2.I have a button on my interface and I need it to dissappear after 20sec,how can I do that,I tried to use a timer but it doesn't dissappear, pls help with a code. Thanks.

    K 1 Reply Last reply
    0
    • M minkinin

      Hi all. 1.pls help,I want to display a blank column on the grid when my field is null in the DB instead of NULL,and when theres a value the grid should display that value. 2.I have a button on my interface and I need it to dissappear after 20sec,how can I do that,I tried to use a timer but it doesn't dissappear, pls help with a code. Thanks.

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

      1. In your query you need to do something like isnull(fieldname,'') as fieldname So if you query currently is: select fieldname from table It should be: select isnull(fieldname,'') as fieldname from table 2. I am not sure why you would want a button to dissappear after 20 secs. That sounds a little weird. Anyway, it would depend of if this is a windows app or a web app. If it is a windows app, after you set the button to false in the timer you also probably need to call Application.DoEvents(). If you are in a we app it is a lot more difficult. I have some ideas, but I will assume for now you are talking about a windows app. Hope that helps. Ben

      M 1 Reply Last reply
      0
      • K kubben

        1. In your query you need to do something like isnull(fieldname,'') as fieldname So if you query currently is: select fieldname from table It should be: select isnull(fieldname,'') as fieldname from table 2. I am not sure why you would want a button to dissappear after 20 secs. That sounds a little weird. Anyway, it would depend of if this is a windows app or a web app. If it is a windows app, after you set the button to false in the timer you also probably need to call Application.DoEvents(). If you are in a we app it is a lot more difficult. I have some ideas, but I will assume for now you are talking about a windows app. Hope that helps. Ben

        M Offline
        M Offline
        minkinin
        wrote on last edited by
        #3

        Thanks for your efforts,but it doesn't work the way I want it,maybe is because my question wasn't clear enough, ok my data in the Db is like this: Name TimeIN TimeOUT me 08:15 Null so I want it to be like this on a grid: Name Time TimeOUT Me 08:15 but when the TimeOUt field has a value in the DB it should display that field on the grid eg Name Time TimeOUT Me 8:15 4:30 I hope this clarify my question now.

        S K 2 Replies Last reply
        0
        • M minkinin

          Thanks for your efforts,but it doesn't work the way I want it,maybe is because my question wasn't clear enough, ok my data in the Db is like this: Name TimeIN TimeOUT me 08:15 Null so I want it to be like this on a grid: Name Time TimeOUT Me 08:15 but when the TimeOUt field has a value in the DB it should display that field on the grid eg Name Time TimeOUT Me 8:15 4:30 I hope this clarify my question now.

          S Offline
          S Offline
          sam
          wrote on last edited by
          #4

          Edit NullText property of your Data Grid Column give a space there.

          1 Reply Last reply
          0
          • M minkinin

            Thanks for your efforts,but it doesn't work the way I want it,maybe is because my question wasn't clear enough, ok my data in the Db is like this: Name TimeIN TimeOUT me 08:15 Null so I want it to be like this on a grid: Name Time TimeOUT Me 08:15 but when the TimeOUt field has a value in the DB it should display that field on the grid eg Name Time TimeOUT Me 8:15 4:30 I hope this clarify my question now.

            K Offline
            K Offline
            kubben
            wrote on last edited by
            #5

            I am suprised it doesn't work since I use the techique all over the place. So if your existing query is: Select Name, TimeIN, TimeOUT from yourTable All you should have to do is: Select Name, TimeIN, IsNull(TimeOut,'') as 'TimeOut' from yourTable If you are using Sql server. If you ask me it is really best to handle this sort of thing on the database side in what you are passing to .net then try to handle it in .net. Ben

            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