Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Do You guys know what kind of indexing appDt(0) and schedDt(0) have? Why they didn't indicate .rows property instead?

VB
Dim tb As TextBox = CType(UserIdTextBox, TextBox)
           Dim userName As String = tb.Text
           Dim gvw As GridView = CType(sender, GridView)
           Dim scheduleId As Integer = Integer.Parse(gvw.SelectedRow.Cells(1).Text)

           Dim caspbll As New CASpBLL

           Dim schedDt As tbCASp_ExamScheduleDataTable = caspbll.GetExamSchedule(scheduleId)
           Dim appDt As QuickAppInfoDataTable = caspbll.AppInfoSummary(userName)
           Dim regDt As tbCASp_RegistrationDataTable = caspbll.GetExamReg(userName, scheduleId)
           If appDt IsNot Nothing AndAlso appDt.Rows.Count = 1 Then
               If regDt IsNot Nothing AndAlso regDt.Rows.Count = 0 And (Not caspbll.AlreadyRegisteredForThisExam(appDt(0).ApplicationID, schedDt(0).ExamID)) Then
                   Dim RegNumber As String = ""
                   Dim RegId As Integer
                   RegId = caspbll.NewRegistration(appDt(0).ApplicationID, scheduleId, HttpContext.Current.Request.UserHostAddress, RegNumber)
                   Dim CASp As New CASpBLL
                   CASp.UpdateExamRegFromDSA601(Today.ToShortDateString(), SpecialAccomodationCheckBox.Checked, NoSaturdayExamCheckBox.Checked, RegId)
                   Response.Redirect(String.Format("view_registration.aspx?regid={0}", RegId.ToString()))
               Else
                   lblErrorMsg.Visible = True
                   lblErrorMsg.Text = "User has already registered for a session for this exam"
               End If
           Else
               lblErrorMsg.Visible = True
               lblErrorMsg.Text = "UserId doesn't exist."
           End If
Posted
Comments
Ron Beyer 27-Nov-13 10:25am    
How could we possibly know? We don't have access to the rest of your code!
phil.o 27-Nov-13 11:46am    
I asked my crystal-ball but it did not know; sorry.
More seriously, how could we possibly know how your QuickAppInfoDataTable and tbCASp_RegistrationDataTable classes behave since you did not provide their definitions?

1 solution

No one can really answer this for you without seeing the code for the objects you're accessing. But I'd expect that your QuickAppInfoDataTable and tbCASp_RegistrationDataTable types are both implementing iEnumerator/iEnumerable, so referencing an instance of either is already referencing the row for you. http://msdn.microsoft.com/en-us/library/system.collections.ienumerator(v=vs.110).aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900