sorry for not given much details about the error message. it was just that i was a little frustrated.
lets asume am writting a module to retrieve record(s) from a database. asume the controller class is NewsController.vb and the info class is NewsInfo.vb
i have something like this in the controller class
Public Shared Function getAllNews(ByVal ModuleId As Integer) As NewsInfo
Return CType(CBO.FillObject(DataProvider.Instance().getAllNews(ModuleId), GetType(NewsInfo)), NewsInfo)
End Function
if the record in the database is empty, it will give me the Error "Object reference not set to an instance of object". it took me a 2day to note this. what am thinking is that the CBO class didn't handle this execption.
i even tried this:
if NewsController.getAllNews(ModuleId) = nothing Then .....
it still brought the same Error. What i did was to put it in the try block, and ignor it, and that solves the error when ever the records from the database where empty.
Thanks any way