Tuesday, September 21, 2010

isDbNULL with Datarow in .NET

You want to check for isdbnull while using datarow from a datatable/dataset this is how you use it..

C# CODE:

Assuming orow is the datarow you are working with ...

if (!Convert.IsDBNull(orow [5]))
{
// Do some thing
}
else

{
//Do some thing else...
}

Thanks,
Suman