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

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -