B
Bernie Hunt
Sorry folks, I sure this is a stupid one, but I'm stuck. Just starting
with .Net so working with the ado.net objects are not natural to me yet.
This routine should open a datareader with a lot of records, step through
the records and display the field contents to text boxes on a form, along
with a running total displayed on the form. Nothing fancy.
The problem is it only displays one record. I verified the select
statement pushs are 1K records, so I have to assume a problem in my loop.
Can anyone tell me what stupid thing I'm doing wrong?
Thanks,
Bernie
Private Sub ProcessReport()
Dim drPatients As Odbc.OdbcDataReader
Dim intPatientCounter As Integer 'counter for processed
patients
intPatientCounter = 0
cxnEclipse.Open()
txbStatusOutput.Text = "Connection to Eclipse Open"
txbStatusOutput.Text = "Retrieving Patient List"
drPatients = cmdGetPatientList.ExecuteReader()
txbStatusOutput.Text = "Processing Patients"
Do While drPatients.Read
txbTotalPatients.Text = CStr(intPatientCounter + 1)
txbPatientName.Text = RTrim(CStr(drPatients("LastName"))) &
", " & RTrim(CStr(drPatients("FirstName")))
txbPatientID.Text = CStr(drPatients("PatientID"))
Loop
txbStatusOutput.Text = "Patients Completed"
drPatients.Close()
cxnEclipse.Close()
txbStatusOutput.Text = "Eclipse Connection Closed"
End Sub
with .Net so working with the ado.net objects are not natural to me yet.
This routine should open a datareader with a lot of records, step through
the records and display the field contents to text boxes on a form, along
with a running total displayed on the form. Nothing fancy.
The problem is it only displays one record. I verified the select
statement pushs are 1K records, so I have to assume a problem in my loop.
Can anyone tell me what stupid thing I'm doing wrong?
Thanks,
Bernie
Private Sub ProcessReport()
Dim drPatients As Odbc.OdbcDataReader
Dim intPatientCounter As Integer 'counter for processed
patients
intPatientCounter = 0
cxnEclipse.Open()
txbStatusOutput.Text = "Connection to Eclipse Open"
txbStatusOutput.Text = "Retrieving Patient List"
drPatients = cmdGetPatientList.ExecuteReader()
txbStatusOutput.Text = "Processing Patients"
Do While drPatients.Read
txbTotalPatients.Text = CStr(intPatientCounter + 1)
txbPatientName.Text = RTrim(CStr(drPatients("LastName"))) &
", " & RTrim(CStr(drPatients("FirstName")))
txbPatientID.Text = CStr(drPatients("PatientID"))
Loop
txbStatusOutput.Text = "Patients Completed"
drPatients.Close()
cxnEclipse.Close()
txbStatusOutput.Text = "Eclipse Connection Closed"
End Sub