tk.unlimited
Active member
- Joined
- Apr 2, 2005
- Messages
- 27
- Programming Experience
- 1-3
Hey All!!
Having troubles with searching for data within a DB. I have to RESTRICT the HTML report output by using an IF statement and selecting only the records where the student Birth Month matches a month entered by the user (i.e user defined month). For Example, if the user enters 1, the report should only show the students born in January. I am uncertain whether it lies in the SQL Query which currently is
" or if it lies within the code itself.. Im sure you have to put it in the Do Loop though
I have the following code:
Having troubles with searching for data within a DB. I have to RESTRICT the HTML report output by using an IF statement and selecting only the records where the student Birth Month matches a month entered by the user (i.e user defined month). For Example, if the user enters 1, the report should only show the students born in January. I am uncertain whether it lies in the SQL Query which currently is
VB.NET:
sSql = "select * from student
I have the following code:
VB.NET:
iTotal = 0
Do While oDataReader.Read() And iTotal <= 10
' --- Place here If Statement for Search Report to be completed in :
' --- Page 6 - Point 3 - Bullet Point No 8 Restricting HTML to a Month
sRecordLine = "<TR>"
For iColCounter = 0 To oDataReader.FieldCount - 1
' --- Below is an If Statement to format Dates .. Advanced
If dtTempDate.GetType.Equals(oDataReader.Item(iColCounter).GetType) Then
sColOutput = CDate(oDataReader.Item(iColCounter)).ToShortDateString
Else
sColOutput = oDataReader.Item(iColCounter).ToString
End If
sRecordLine = sRecordLine & "<td>" & sColOutput & "</td>"
Next
sRecordLine = sRecordLine & "</TR>"
iTotal = iTotal + 1
sPageText = sPageText & sRecordLine & vbCrLf
'End If ' --- end if of Search Report If Statement
Loop