Answer: We can check with not null in C# and not nothing in VB.Net to check whether object is initialized or not
As
In C#:
Dataset ds = new Dataset();
if(ds!=null)
{
//read data from Dataset
}
In VB.Net
Dim ds as Dataset = Nothing
If(Not ds is Nothing)
{
//read data from Dataset
}
Asked In: Many Interviews |
Alert Moderator