SQL Profiler with .NET
I often use SQL Profiler to get an idea of what SQL is being launched by a .NET application. The Application Name defaults to ".NET SqlClient Data Provider" which means that if you have several applications running using ADO.NET, you can not distinguish the trace log by looking at the application name.
To get round this, simply add an "Application Name" attribute to your connection string. See example below:
Data Source=servername;Application Name=The Wicked Web App;Initial Catalog=Database Name;User ID=theuser;Password=pwd
Refer to this article about the
SqlConnection.ConnectionString Property.