How to find the null fields in the datareader

Platform: ASP.NET| Category: ADO.NET

VB.NET


If dbReader('fieldname').Tostring= DBnull.Value.ToString()
	’Empty field value
Else
	’Display value
End if

C#


if (dbReader['fieldname').ToString() == DBNull.Value.ToString() )
{
	//Empty field value
}
else
{
	//display Value
}

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.