Home > View Post

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.

Tags: SQL

Bruusi Post By Bruusi
11:20 AM
15 Nov 2005

» Next Post: Better understand Cookies with ieHTTPHeaders
« Previous Post: Case insensitive dictionaries and hashtables

Comments are closed for this post.

Posted by rudraksha @ 05 May 2011 1:20 PM
yes. when multiple are running an issue

© 2005 - 2022 Josh Twist - All Rights Reserved.