RODEhard
asked on
How do I avoid the Object reference not set error when ExecuteXmlReader has no records?
If have a SQL Server 2000 stored procedure that returns xml using "for xml auto" and also returns a return value. If I use ExecuteXmlReader, I get an "Object reference not set to an instance of an object" error when there are no records that meet the criteria in my stored procedure because no xml is returned. Is there anyway to avoid this error?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That way you know it has data and it will never fail. I would gues that would be much faster in your scenario.
Regards,
Fouad