none
How to Broadcat informational message? RRS feed

  • Question

  • Hi All

     

    I have an VB.NET 2005 application that open a connection on a database In SQL server 2005 and I want when any data were inserted by this application in a spacific table the data base send an notification to the application. I did this scenario

     

    I created a trigger on that table for insert, this trigger raise an informational error using RAISERROR and set the severity value with 10 as following

     

    RAISERROR ('Warnning Message', 10,1)

     

    Then in the application I handled the event InfoMessage of the connection to receive the informational message in the application as following

     

    AddHandler DBConnection.InfoMessage, AddressOf My_InfoMessage

     

    Public Sub My_InfoMessage(ByVal sender As Object, ByVal e As System.Data.SqlClient.SqlInfoMessageEventArgs)

    MessageBox.Show("info message event: " & e.Message)

    End Sub

     

    The problem is that when two instance of the EXE work and every instance open a connection and data inserted in the table from one EXE of them the informational message is raised only to the EXE that inserted in the table and I want the  informational message is raised to the two EXE in other words I want to broadcast the informational message to all connections opened on this database.

     

    Could someone help me

    Thnx

    Thursday, November 8, 2007 7:29 AM

All replies

  • First, you will probably have much better luck getting help if you post this question to a forum that is related to SQL Server development and not SQL Server Integration Services.

     

    With that said, you are probably going to have to "roll your own" broadcast mechanism for this. The built-in mechanisms for propagating errors are designed to pass the information back up the call stack of a single application, so if you want to cross that 1:1 boundary, you'll probably have to build it yourself.

    Thursday, November 8, 2007 1:03 PM
  •  

    Moving thread...
    Friday, November 9, 2007 6:29 AM