Trigger returns error BUT NOT on Query Analyser

  • Good day all. 

    I have created a SQL trigger that insert records into Oracle.  It works fine when I run it from SQL query analyser, but when I put the trigger into a table and try to insert the records I get this error, please let me know what else to do

    Unhandled Exception: System.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a s

    ervice application.

       at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)

       at System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)

       at Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title)

       at ClientBroking.MaintainData.main()

  • How is it inserting them? It appears that something is trying to show a dialog box.

     

  • Ok Steve, this is my code in the table trigger, and it takes the parameters to the dll.  I didn't write the dll it was writen by the vendor, but if there is anyway you can help with more info, I will inform the vendor to correct whatever is wrong

    DECLARE @cmd sysname, @var sysname, @con sysname

    SET @var = (select max(id) from Inserted)

    SET @con = (Select principal from ISLPrimeBrokersEquitiesOutput where id in (Select max(id) from Inserted))

    SET @cmd = 'C:\ClientBroking.exe ' + @var + ' ,'+ 'ISLPrimeBrokersEquitiesOutput'+','+ @con+''

    EXEC master..xp_cmdshell @cmd

     

  • I think there are 2 error here.  Looks like the dll that calls your SP does not have correct error handling.  The dll is  running as a service, but the error handling code is trying to display a messagebox.  probably the error should be logged in a log file or event viewer.  That's the first error.

    Once this is corrected. then you would know what actual error from the insert.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply