Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Suppressing Null Fields

Posted on 2011-09-13
1
199 Views
Last Modified: 2012-05-12
I have a formview only in view mode that displays when a record is selected in a gridview on a web page. There are a couple of fields that can be null. How can I not display the labels that contain those values if the field is null in the database?
0
Comment
Question by:Hers2keep
1 Comment
 
LVL 2

Accepted Solution

by:
junkymail1 earned 500 total points
ID: 36532355
I ran into this problem as well.  All I could figure out to do was to do a try on the data:

try
 {
Table.PROD2_DATE = (DateTime)dataRow[0]["PROD2_DATE"];
}
catch
{
Table.PROD2_DATE = Date.Now();
 }

My page would blow up if I didn't check if the values were null.  Hope it helps.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question