Okay, I have this app that has the below code and anything under the Msg column is not returning.. I can get the EmployeeID, timestamp the Msg header and the status but the data from the Msg column does not appear
The query works directly in the sql query screen but not from here.. am I doing something wrong?
The table is called chat and it has columns of: EmpID, TimeStamp, Msg, Status
VB Code:
Private Function GetUnread() As String(,) Dim Conn As New DBConnection Dim qry As String(,) = Conn.ReturnQuery("SELECT * FROM CHAT WHERE Status='0'") Conn.ExecuteQuery("UPDATE Chat Set Status='1' WHERE Status='0'") Return qry End Function
VB Code:
Private Sub CheckMsg() Dim Conn As New DBConnection, EmpName As String(,) Dim qry2 As String(,) = Conn.ReturnQuery("SELECT EmployeeID FROM Chat WHERE STATUS='0'") Dim qry As String(,) = GetUnread() Dim x As Integer, TmpID As String Dim txtCurrent As String = txtChat.Text Dim AddLine As String If Not IsNothing(qry2(0, 0)) Then Dim y As Integer = ReturnArrayLength(qry2.Length) For x = 1 To y TmpID = qry(0, x) EmpName = Conn.ReturnQuery("SELECT EmployeeName FROM Employee WHERE EmployeeID='" & TmpID & "'") AddLine = Trim(EmpName(0, 1)) & " " & Trim(qry(1, x)) & ": " & Trim(qry(2, x)) txtChat.Text = txtChat.Text & vbCrLf & AddLine Next End If End Sub




Reply With Quote