SQL event logging in ADO.net

We want to log sql events and its working but the problem is it always says sa as an user. Whereas I would like this to be personalized.

Is there anyway in ADO.Net where I can pass custom display name so that the logging of sql shows who the user is doing what in my DB?

I know this question looks quite wierd but this is how my requirement is. Any comments are highly appreciated.

Answers


Don't log-in as SA! That's a real big security problem just waiting to happen. Create other SQL users, and use them in your connection string. That will let you control which user is shown on the profile, and also add you quite a bit of security.

Note: You could also log in based on your Windows credentials, which is even safer in some production environments, but you might not want to worry about it right now.


Need Your Help

Ruby on Rails Tutorial by Michael Hartl. Failing test in Chapter 8.29

ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-3.1

I am a newbie working through Hartl. Got to the end of Chapter 8 and when I check my browser for the sign in/sign out every things seems AOK. However when I run this test:

Data Binding to the contents of a list

c# wpf xaml data-binding

I am trying to bind the properties of the items in a list to a data grid. I have the following code: