Hi Guys,
I have developed a desktop client application which runs on the local machines of some clients.
I have another server application which is basically a filewatch application which runs every 5 secs . What this server application does is check the SQL database for any new updates, & if any new updates are available then it sends the new value to all the client apps through MSMQ.
But my problem is that all my clients do not get the data that I send through MSMQ.
Whenever a client logs in I insert that clients Machine name & Quename in the database, then whenever I send data I check all the connected users in this database & send them the data through MSMQ by using a for loop.
Given below is the code that I have used.
'''''''''''''Here I pass the parameters to this function which I need to pass to the users...............
Sub SendDataThroughMSMQ(ByVal sennifty As Decimal, ByVal nsebse As String)
Dim myconn As SqlConnection = New SqlConnection("server=192.168.30.150;database=finwizfinal;user id=BeeSys;password=BeeSys")
'Check For connected users...
Dim mydata As SqlDataAdapter = New SqlDataAdapter("select * from EQUITY_CONNECTED_USERS order by CompName desc", myconn)
Dim myds As DataSet = New DataSet
Try
mydata.Fill(myds, "EQUITY_CONNECTED_USERS")
Catch
MsgBox(Err.Description)
End Try
Dim mydt As DataTable = New DataTable
Dim mydr() As DataRow
mydt = myds.Tables("EQUITY_CONNECTED_USERS")
mydr = mydt.Select
Dim str, compname, Quename As String
Dim sennif As String
If sennifty > 10000000 Then
sennif = sennifty & " cr"
ElseIf sennifty > 10000000 And sennifty < 100000 Then
sennif = sennifty & " lac"
Else
sennif = sennifty
End If
Dim i As Integer
For i = 0 To mydr.Length - 1
compname = mydr(i)("CompName")
Quename = LCase(mydr(i)("QueName"))
Dim mq As System.Messaging.MessageQueue = New System.Messaging.MessageQueue("FormatName:Direct=OS:" & Trim(compname) & "\Private$\" & LCase(Trim(Quename)))
str = nsebse & "|" & Trim(sennif)
Try
mq.Send(str)
'waitFor(0.5)
Catch
MsgBox(Err.Description)
End Try
Next
End Sub
But I am not able to send data to all the users. Some users receive the data but some do not.
Is there a solution for this or is ther a way to receive notifications whenever a user receives data.
-Sunil