Hi,

I am trying to implement event driven message handling in Visual C#
using the ODBC library.

I have a command and connection defined and I have the following code:

thisConnection.InfoMessage += new OdbcInfoMessageEventHandler
(ConnInfo);
thisCommand.ExecuteNonQuery();

where thisConnection/Command are the connection/command instances I
defined for my query. I definded ConnInfo as follows:

private void ConnInfo(object sender, OdbcInfoMessageEventArgs e)
{
    MessageBox.Show(e.Message.ToString(), "Message",
MessageBoxButtons.OK);
}

however this event does not trigger my method when my query returns
system messages. I use sybase ase, and use the print command to output
messages in case anyone is familiar.

I am 90% guessing the code as I write it out as I am somewhat new to
C#. How do I go about detecting system messages while the query is
executing (before thisCommand.ExecuteNonQuery() completes) say to pull
out info regarding query status, how much has been completed, etc...

Thanks in advance for your help.
Alon

Reply via email to