Click here to Skip to main content
15,896,111 members
Articles / Database Development / SQL Server

Database Helper Class Library to Ease Database Operation

Rate me:
Please Sign up or sign in to vote.
3.09/5 (9 votes)
14 Apr 2007CPOL4 min read 88.3K   3K   57  
Database Helper Class Library to Ease Database Operation
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.Resources;
using System.Reflection;

namespace Microsoft.ApplicationBlocks.ExceptionManagement
{
	/// <summary>
	/// Installer class used to create two event sources for the 
	/// Exception Management Application Block to function correctly.
	/// </summary>
	[RunInstaller(true)]
	public class ExceptionManagerInstaller : System.Configuration.Install.Installer
	{
		private System.Diagnostics.EventLogInstaller exceptionManagerEventLogInstaller;
		private System.Diagnostics.EventLogInstaller exceptionManagementEventLogInstaller;
		
		private static ResourceManager resourceManager = new ResourceManager(typeof(ExceptionManager).Namespace + ".ExceptionManagerText",Assembly.GetAssembly(typeof(ExceptionManager)));
		
		/// <summary>
		/// Constructor with no params.
		/// </summary>
		public ExceptionManagerInstaller()
		{
			// Initialize variables.
			InitializeComponent();
		}

		/// <summary>
		/// Initialization function to set internal variables.
		/// </summary>
		private void InitializeComponent()
		{
			this.exceptionManagerEventLogInstaller = new System.Diagnostics.EventLogInstaller();
			this.exceptionManagementEventLogInstaller = new System.Diagnostics.EventLogInstaller();
			// 
			// exceptionManagerEventLogInstaller
			// 
			this.exceptionManagerEventLogInstaller.Log = "Application";
			this.exceptionManagerEventLogInstaller.Source = resourceManager.GetString("RES_EXCEPTIONMANAGER_INTERNAL_EXCEPTIONS");
			// 
			// exceptionManagementEventLogInstaller
			// 
			this.exceptionManagementEventLogInstaller.Log = "Application";
			this.exceptionManagementEventLogInstaller.Source = resourceManager.GetString("RES_EXCEPTIONMANAGER_PUBLISHED_EXCEPTIONS");

			this.Installers.AddRange(new System.Configuration.Install.Installer[] {
																					  this.exceptionManagerEventLogInstaller,
																					  this.exceptionManagementEventLogInstaller});
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Malaysia Malaysia
Had worked as analyst programmer for 4 years. Now helping in family business but still involved actively in .Net development whenever there is a free time.

Comments and Discussions