Dim cmd3 As New SqlClient.SqlDataAdapter("Select * from tblPatientNote where lngPatientid = '" & lngpatientid & "' order by bytNote, dtmcreate desc", Connection1)
Dim countnotes As Integer
Dim note, strnote, strcreate, memnote, dtmcreate, notebc, notev, strnotev, strcreatev, memnotev, dtmcreatev
Try
countnotes = cmd3.Fill(dsNotes, "tblPatientNote")
Catch ex As Exception
MsgBox(ex.Message)
End Try
Do While i <> countnotes
note = note & i & ".Text"
notebc = note & i & ".BackColor"
strnote = strnote & i & ".Text"
strcreate = strcreate & i & ".Text"
memnote = memnote & i & ".Text"
dtmcreate = dtmcreate & i & ".Text"
notev = note & i & ".visible"
strnotev = strnote & i & ".visible"
strcreatev = strcreate & i & ".visible"
memnotev = memnote & i & ".visible"
dtmcreatev = dtmcreate & i & ".visible"
'add to notes and make each visible
If IsDBNull(dsNotes.Tables("tblPatientNote").Rows(i).Item("bytnote")) = False Then
If (dsNotes.Tables("tblPatientNote").Rows(i).Item("bytnote")) = "1" Then
notebc = System.Drawing.Color.Red
note = (dsNotes.Tables("tblPatientNote").Rows(i).Item("bytnote"))
Else
notebc = System.Drawing.Color.White
End If
strnotev = True
strcreatev = True
memnotev = True
dtmcreatev = True
notev = True
End If
If IsDBNull(dsNotes.Tables("tblPatientNote").Rows(i).Item("strnote")) = False Then
strnote = (dsNotes.Tables("tblPatientNote").Rows(i).Item("strnote"))
End If
If IsDBNull(dsNotes.Tables("tblPatientNote").Rows(i).Item("memnote")) = False Then
memnote = (dsNotes.Tables("tblPatientNote").Rows(i).Item("memnote"))
End If
If IsDBNull(dsNotes.Tables("tblPatientNote").Rows(i).Item("dtmcreate")) = False Then
dtmcreate = (dsNotes.Tables("tblPatientNote").Rows(i).Item("dtmcreate"))
End If
If IsDBNull(dsNotes.Tables("tblPatientNote").Rows(i).Item("strcreate")) = False Then
strcreate = (dsNotes.Tables("tblPatientNote").Rows(i).Item("strcreate"))
End If
i = i + 1
Loop
End Sub
|