Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Is there a way to associate an InfoMessage event with a specific SqlCommand? #3021

Unanswered
Metritutus asked this question in Q&A
Discussion options

When receiving information from PRINT or informational RAISERROR statements, there doesn't seem to be a way to tie them back to a specific SqlCommand, as the InfoMessage event is on the SqlConnection, not the SqlCommand, and the SqlInfoMessageEventArgs instance doesn't appear to contain any information identifying the SqlCommand.

Frustratingly, it does look like the SqlCommand instance is passed to the FireInfoMessageEvent method, so to my layman's eye it seems like the information isn't that far away from the creation of the SqlInfoMessageEventArgs instance.

Anyway, is there any way to identify which SqlCommand a message came from?

You must be logged in to vote

Replies: 1 comment

Comment options

This does seem like an oversight. We will investigate further, and if appropriate, come up with an API proposal.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Public API 🆕 Issues/PRs that introduce new APIs to the driver.

AltStyle によって変換されたページ (->オリジナル) /