If i run a SP_who/SP_who2 on my SQL 2000 database to see whos running
what programs, i'm finding a lot of these are only showing ".Net
SqlClient Data Provider" as the program name rather than for example
"My SQL app 1"

We are using VB.net 2.0 with Visual studio 2005, is there a setting i
need to change somewhere for this or some code i can insert into my
app to change its name in the SQL database?

I have seen this done in older versions but i dont know how to do so.

Regards,

Andy

Re: SQL ProgramName by Jim

Jim
Sat May 06 15:15:20 CDT 2006

www.ConnectionStrings.com is your friend.

You have to set it in the applications connectionstring

Application Name="Your App Name"

The name of the application, or '.Net SqlClient Data Provider' if no
application name is provided.


"Backwards" <Andrew@technicaltraining.co.nz> wrote in message
news:1146944933.416830.137280@i40g2000cwc.googlegroups.com...
> If i run a SP_who/SP_who2 on my SQL 2000 database to see whos running
> what programs, i'm finding a lot of these are only showing ".Net
> SqlClient Data Provider" as the program name rather than for example
> "My SQL app 1"
>
> We are using VB.net 2.0 with Visual studio 2005, is there a setting i
> need to change somewhere for this or some code i can insert into my
> app to change its name in the SQL database?
>
> I have seen this done in older versions but i dont know how to do so.
>
> Regards,
>
> Andy
>



Re: SQL ProgramName by Backwards

Backwards
Sat May 06 15:52:42 CDT 2006

Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() +
";Initial Catalog=northwind;Integrated Security=SSPI"
Dim sql As New SqlClient.SqlConnection(message)
sql.Open()

Thats my current connection string. When i try add the following it
doesnt like it:

Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() +
";Initial Catalog=northwind;Integrated Security=SSPI"
Dim sql As New SqlClient.SqlConnection(message)
sql.application_name = "Example App1"
sql.open()

Any thoughts?


Re: SQL ProgramName by KerryMoorman

KerryMoorman
Sat May 06 17:37:01 CDT 2006

Backwards,

Make it part of the connection string:

Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() +
";Initial Catalog=northwind;Integrated Security=SSPI;Application
Name=Example App 1;"

Kerry Moorman



"Backwards" wrote:

> Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() +
> ";Initial Catalog=northwind;Integrated Security=SSPI"
> Dim sql As New SqlClient.SqlConnection(message)
> sql.Open()
>
> Thats my current connection string. When i try add the following it
> doesnt like it:
>
> Dim message As String = "Data Source=" + Me.ComboBox1.Text.ToString() +
> ";Initial Catalog=northwind;Integrated Security=SSPI"
> Dim sql As New SqlClient.SqlConnection(message)
> sql.application_name = "Example App1"
> sql.open()
>
> Any thoughts?
>
>

Re: SQL ProgramName by Backwards

Backwards
Sat May 06 17:51:33 CDT 2006

Thanks for that but it still shows as the .Net SqlClient Data Provider.

Andy