delegates - Unable to Invoke SqlInfoMessageEventHandler -
I am trying to implement SqlInfoMessageEventHandler
, but not able to help anyone can do? Here's my code:
class program {static zero main (string [] args) {SqlConnection sqlConnect = New SqlConnection (@ "Integrated Security = SSPI; Initial Catalog = DEV_ENV; Data Source = SQL15 "); (SqlCommand command = new SqlCommand ("Select 1 from Select Employee", sqlConnect) {sqlConnect.Open (); SqlConnect.InfoMessage + = New SqlInfoMessageEventHandler (MessageEventHandler); Command.ExecuteNonQuery (); }} Fixed zero message event handler (object sender, SqlInfoMessageEventArgs e) {Console.WriteLine (e.Message); }}
Comments
Post a Comment