Exception:The CurrentRow for table '[dbo].[Query]' could not be evaluated because the CurrentRowIndex is out of range. Business object record count: 0. CurrentRowIndex: -1.
It happens when I call my custom Fill method on the BO and there is no record found. The BO designer.cs code try to use the CurrentRow.
public void FillBySubjectPage(string subjectId, int pageId) // in my BO partial class
{
FillDataTable("SELECT * FROM Query WHERE PatientId = " + subjectId + " AND PageId = " + PageId.ToString());
}
what can I do to prevent this?