Click here to Skip to main content
12,402,211 members (70,672 online)
Rate this:
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:
uses : 

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

1 solution

Rate this: bad
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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 5 Jul 2012
Copyright © CodeProject, 1999-2016
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