Dispalying a blank instead of null.
-
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.
-
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.
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
-
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
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.
-
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.
-
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.
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