Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP VBScript
when database field is null/empty then corresponding text should become invisible
 

 I have developed a web page in front page and using vbscript t language and database in MS acess .
 
in front page I have used dropdown menu which display plant name 
 
when we select any plant name from list it will display corresponding information on the web page i.e
 
Plant name: 
 
Trade name:
 
Synonyms:
 
uses : 
 

my code is like this :b>
Posted 4-Jul-12 21:51pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

To check for null value, you can add codes while retrieving data from database in query.
 
You can do like...
SELECT ISNULL(PlantName, '') as PlantName,
       ISNULL(TradeName, '') as TradeName,
       ISNULL(Synonyms, '') as Synonyms,
       ISNULL(uses, '') as uses,
FROM Plant_Details
WHERE PlantId = @PlantId
So, ISNULL checks the first parameter (ex. PlantName) and if it is NULL, then it will return the second parameter, which is blank in this case ('').
 
Then after getting the values from the DB u can show the same...
 
Happy coding... Smile | :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 189
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 5 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100