Paul Sheriff's Inner Circle

Trusted Advice from a Proven Professional

Member Benefits

Inner Workings
Below is a sample of what you will find on the site.
Tips and tricks for developers

ProductDescription
Adding a Global Exception Handler to Windows Forms .NET 1.1To add a global exception handler to a Windows Forms application you need to add a handler to the ThreadException event of the Application class. This code shows you how to accomplish this.
All About NothingSometimes in your code you will need to check to see if a value is nothing/null or not. In .NET 2.0 there is a new method you can use to check for this condition. The method is the IsNullOrEmpty() method on the string class. Below is an example of using this method in C#.
Automatically Upgrading from VS.NET 2003 to VS.NET 2005Do you have a lot of class libraries and other projects written in .NET 1.1 that you would like to migrate to .NET 2.0? If so, then take advantage of the /Upgrade switch on the command line of the Devenv.exe. The VS.NET IDE has a series of command line switches that you can use to compile and application and starting with VS.NET 2005 there is now a new option to help you upgrade your projects from .NET 1.1.
Avoid SQL Injection Web AttacksMost programmers know by now that you must take certain precautions to ensure you are not subject to SQL injection attacks or cross-site scripting attacks on your web applications. There are many methods that you can use to protect your application from becoming a victim of these attacks.
Clone a Single Row From DataSetThere is no easy way to take a single row from an existing DataSet and copy it to another DataSet. The major reason why it is not so easy is you can not assign a DataRow that exists in one DataSet to another DataSet. As a result you must create a brand new DataRow object and copy all of the values from the original DataRow into this new one. This tip shows you how to do this quickly and easily.
Creating an XML document in memoryIf you need to create an XML document in memory, you can use the XMLDocument class and the XMLNode class to accomplish this. This tip shows you how to do it.
Custom ASP.NET Exception HandlerWe have all seen the default error page that ASP.NET renders when an unhandled error occurs in your .NET code. While this information is wonderful for us as developers, this is not a screen you want your users to view. To stop this screen from coming up for your users read this tip.
Date Handling: Get the Month NameThere are a lot of great date handling methods attached to the DateTime class in .NET. However, if you wish to get information such as the current month name, you will not find it in this class. The reason is because .NET needs to take into account local culture and languages. Thus, routines that return something that is specific to a language or a culture is placed under the System.Globalization namespace. As an example, below is the code you would need to write to return the month name as a string in any language.
Details View / Drop Down List SampleThis came from a Member's question on how to retrieve the value from a DropDownList that was contained within a DetailsView control. This sample shows the complete code.
Encrypting XML FilesI recently had a need to encrypt XML files that were used to store some sensitive information about an application. To make this automated, I created an application that would do the Encryption for me. Click here for a link to the sample code for this utility.
1234
All Rights Reserved© 2006-2007, Paul D. Sheriff