Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Show if DB field NOT NULL

Reply
Thread Tools

Show if DB field NOT NULL

 
 
Keith
Guest
Posts: n/a
 
      07-09-2004
What is the correct code to use to hide a section if a specific DB field is
NULL.

Thanks


 
Reply With Quote
 
 
 
 
Dave Anderson
Guest
Posts: n/a
 
      07-10-2004
"Keith" wrote:
> What is the correct code to use to hide a section if a specific DB
> field is NULL.


Define "hide a section".


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.


 
Reply With Quote
 
 
 
 
Jeff Cochran
Guest
Posts: n/a
 
      07-10-2004
On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:

>What is the correct code to use to hide a section if a specific DB field is
>NULL.


Hide a section as in using DHTML to hide/unhide? Try a DHTML group
for that answer.

If you're looking for an ASP-only answer:

IF DBField <> Null Then
Response.Write "Hidden Section"
End If

Jeff
 
Reply With Quote
 
Keith
Guest
Posts: n/a
 
      07-10-2004
Sorry - badly written question.

Hide a section as in don't process a section of the page if a DB field is
NULL

"Dave Anderson" <(E-Mail Removed)> wrote in message
news:40ef4669$0$235$(E-Mail Removed).. .
> "Keith" wrote:
> > What is the correct code to use to hide a section if a specific DB
> > field is NULL.

>
> Define "hide a section".
>
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message.

Use
> of this email address implies consent to these terms. Please do not

contact
> me directly or ask me to contact you directly for assistance. If your
> question is worth asking, it's worth posting.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-10-2004
Jeff Cochran wrote:
> On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:
>
>> What is the correct code to use to hide a section if a specific DB
>> field is NULL.

>
> Hide a section as in using DHTML to hide/unhide? Try a DHTML group
> for that answer.
>
> If you're looking for an ASP-only answer:
>
> IF DBField <> Null Then
> Response.Write "Hidden Section"
> End If
>
> Jeff

Minor correction:
IF Not DBField Is Null Then

or

If IsNull(DBField) = False Then

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      07-10-2004
On Sat, 10 Jul 2004 08:50:10 -0400, "Bob Barrows [MVP]"
<(E-Mail Removed)> wrote:

>Jeff Cochran wrote:
>> On Fri, 9 Jul 2004 23:39:15 +0100, "Keith" <@.> wrote:
>>
>>> What is the correct code to use to hide a section if a specific DB
>>> field is NULL.

>>
>> Hide a section as in using DHTML to hide/unhide? Try a DHTML group
>> for that answer.
>>
>> If you're looking for an ASP-only answer:
>>
>> IF DBField <> Null Then
>> Response.Write "Hidden Section"
>> End If
>>
>> Jeff

>Minor correction:
>IF Not DBField Is Null Then
>
>or
>
>If IsNull(DBField) = False Then


Bleh! Should stop answering posts at 2:00 am...

Especially since I just ran through an IsNull() programming section
during the day.

Jeff
 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      07-10-2004
On Sat, 10 Jul 2004 13:34:28 +0100, "Keith" <@.> wrote:

>Sorry - badly written question.
>
>Hide a section as in don't process a section of the page if a DB field is
>NULL


You can't "not process a page" because until you process the page you
can't determine if the field is null. You can branch based on it
being null, or else you'll need to use two pages, or try to accomplish
a conditional include, which is more work thatn the system should do.

Jeff

>"Dave Anderson" <(E-Mail Removed)> wrote in message
>news:40ef4669$0$235$(E-Mail Removed). ..
>> "Keith" wrote:
>> > What is the correct code to use to hide a section if a specific DB
>> > field is NULL.

>>
>> Define "hide a section".
>>
>>
>> --
>> Dave Anderson
>>
>> Unsolicited commercial email will be read at a cost of $500 per message.

>Use
>> of this email address implies consent to these terms. Please do not

>contact
>> me directly or ask me to contact you directly for assistance. If your
>> question is worth asking, it's worth posting.
>>
>>

>


 
Reply With Quote
 
Binoj Antony
Guest
Posts: n/a
 
      07-12-2004
IF (NOT ISNULL(DBField)) THEN
' Do something
ELSE
' Do Something else
END IF

This works best for me...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript validation for a not required field, field is onlyrequired if another field has a value jr Javascript 3 07-08-2010 10:33 AM
how to show an Image field from a SQL Server table field to a aspx page J Sahoo ASP .Net 3 04-30-2009 08:30 PM
1.Enter space bar for field names and save the field.The field shoud not get saved and an alert should be there as"Space bars are not allowed" Sound Javascript 2 09-28-2006 02:43 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
comparing field data from previous field in loop with null values abbylee26@hotmail.com ASP General 6 02-15-2006 01:59 PM



Advertisments