SQL ConnectionString Application Name Property

by Mark Milec 4/24/2008 3:54:00 AM

When you have several .net applications or websites connecting to the same database, they all show up in SQL Profiler with the same Application Name ".Net SqlClient Data Provider". I just learned that you can add an Application Name property to the connection string so you can make a unique name for each application.

connectionString="Data Source=MyServer;Initial Catalog=MyDatabase;Persist Security Info=True;User ID=MyUserName;Password=MyPassword;Application Name=My Application"

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Global Exception Handling in C#

by Mark Milec 4/7/2008 9:10:00 AM

I've been using the Application_Error event in ASP.NET as a global exception handler for a while.  While looking for a way to implement something similar for Windows Forms I found this post: http://blogs.msdn.com/tom_krueger/archive/2005/02/17/375602.aspx   explaining how to use Application.ThreadException to do just that.

I then found out that Application.ThreadException is not available in the .net Compact Framework but as explained here: http://www.danielmoth.com/Blog/2004/12/appdomainunhandledexception-part-1.html, AppDomain.CurrentDomain.UnhandledException can be used to accomplish the same thing.

There are some problems with using AppDomain.CurrentDomain.UnhandledException as explained here: http://www.codinghorror.com/blog/archives/000201.html

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

About the author

Name of author Mark Milec
Senior Application Developer at Atlas Tube

View Mark Milec's profile on LinkedIn E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent comments

    Archive

    Authors

    Categories

    None


    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2010

    Sign in