SQL Connection Program Name

  • Thread starter Thread starter Charles Collins
  • Start date Start date
C

Charles Collins

Is there a way to set the program name for a connection so that it is a bit
more descriptive than ".Net SqlClient Data Provider"?

Thanks,
Charles
 
Declare a variable to be of that type?

I'm not quite clear on what you are asking here.
 
In your connection string add an "Application Name".

Like so:

<add key="ConnectionString"
value="server=MyServer;Trusted_Connection=true;database=MyDB;Application
Name=MyApp"/>

It will show up in SQL Profiler as "MyApp". Great way to filter in
Profiler.

HTH,
Greg
 
I think he means the 'application name' that is reported to SQL. Like if you
run "sp_who2" in SQL Query Analyzer, the column for ProgramName.
 
That's it, thanks.


Greg Burns said:
In your connection string add an "Application Name".

Like so:

<add key="ConnectionString"
value="server=MyServer;Trusted_Connection=true;database=MyDB;Application
Name=MyApp"/>

It will show up in SQL Profiler as "MyApp". Great way to filter in
Profiler.

HTH,
Greg
 
Back
Top