Solved

Suppressing Null Fields

Posted on 2011-09-13
1
197 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Icons and Colors for Terms 3 24
DateTimepicker 4 33
how to read json value 2 30
WCF Service Application cannot connect from TCP terminal 1 12
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now