C# Corner

Resources  
  • FileDownloader : Download files using HTTPJan 10, 2000. This application contains a Form and a Class module . From Form we create a thread which execute the procedure to handle the NET download. This application can be enhance to do more down load as in Download manager by creating more threads.
  • Read a file using C#Jan 15, 2000. This program just demonstrate the use of FileStream & StreamReader.
  • FileStream : Read or Write Data StreamsDec 13, 2000. FileStream class can be used to read/write data to a file with the help of StreamReader and StreamWriter classes.
  • Handling Mouse Events in C#Jan 25, 2001. This article explains how to handle mouse events in C# or VB. In C#, you write a delegate and then write an event handler.
  • ADO.NET DataSet ProgrammingMar 20, 2001. A sample project shows you how to add, edit, delete, navigate, save records in a database using DataSet.
  • Developing Web Applications in VS.NET Mar 29, 2001. This tutorial describes about Step-by-step tutorial guides you towards developing your first web application.
  • Find Files in C#May 01, 2001. I have developed a small application in c#, which helps in searching u'r hard disk for files of the desired extention.
  • Line Numbering Utility in C# and JavaMay 08, 2001. This is the first of the series of programs I wish to write to help myself get a handle on C#.
  • Exception HandlingJun 12, 2001. Exceptions in C# provide a structured, and type-safe way of handling both system level and application level error conditions. The exception mechanism in C# is very similar to that of C++, with a few important differences.
  • Creating a screen saverJun 21, 2001. Creating a screen saver is an interesting topic. A screen saver is a maximized form that contains no borders and caption.
  • Time TickerJun 26, 2001. Graphics Class encapsulates a GDI+ drawing surface. The FromHWND method is used to create a new instance of the Graphics class from a window handle. Clear method fills the entire drawing surface with the specified RGB color by using Color class. DrawString method draws a string using Font and SolidBrush classes.
  • Exception HandlingJul 21, 2001. Exceptions in C# provide a structured, and type-safe way of handling both system level and application level error conditions. The exception mechanism in C# is very similar to that of C++, with a few important differences.
  • ASP.NET and VB.NET Error HandlingAug 24, 2001. ASP.NET and VB.NET both are providing excellent error handling options when compared with ASP and VB6. In VB.NET we can make use of the structured way of error handling with the Try & Catch statement.
  • Validation Controls in Web Forms: Part IAug 24, 2001. Validation is one of the less talked about areas – often taken for granted.
  • Exception Handling in C#Oct 17, 2001. Exception handling is a builtin mechanism in .NET framework to detect and handle run time errors.
  • Exceptions and Exception StackNov 16, 2001. The purpose of this tutorial is to explain firstly how you would go about creating your own set of exceptions to trap error conditions that could occur in your code or library, for your own benefit or for the benefit of another developer using your library. The second lesson is on how the C# exception stack works, and how you can use it to catch all types of exceptions.
  • Event Handling in C#Dec 10, 2001. This article shows you how to write control, mouse, and keyboard event handlers in C#.
  • Observer and .NET event delegatesDec 17, 2001. The purpose of this article is to try to introduce observer pattern and compare it to .NET event delegate handling of notifications.
  • Exception Handling in C#Jan 03, 2002. In C# Exception is a class in the system namespace. An object of an exception is that describe the exceptional conditions occur in a code That means, we are catching an exception, creating an object of it, and then throwing it. C# supports exceptions in a very much the same way as Java and C++.
  • Bridge Patterns in C# Jan 17, 2002. Bridge Pattern is commonly known as Handle/Body idiom in C++ community. This pattern is used for decoupling an abstraction from its implementation so that the two can vary independently.
  • xBase Engine for C# and VB.NETFeb 25, 2002. This library is written to handle DBF files from C# or VB.NET applications.
  • Event Handling in .NET using C#Mar 13, 2002. In this article I discuss the event handling model in .NET using C#. The discussion starts with an introduction to the concept of delegates and then it extends that concept to events and event handling in .NET.
  • Low Cost Credit Card VerificationMar 15, 2002. The last digit of a credit card is a check digit that is used to detect keystroke errors when a check card is entered into a computer.
  • SQL Server Database ExplorerMar 20, 2002. This application connects to a running SQL Server 2000 and displays all the available databases in it.
  • MP3 JukeBoxApr 30, 2002. This is stable code and more generic than the first release. It has better error handling now to make it more 'idiot proof'.
  • Custom Error Handling in ASP.NETMay 30, 2002. Structured exception handling is a fundamental part of the CLR and provides .Net programmers a great way of managing errors. In addition to CLR exception system, ASP.Net also provides ways of handling errors.
  • Writing a Single Event Handler for Multiple ControlsJul 22, 2002. Writing a Single Event Handler for Multiple Controls by Giuseppe Russo. Jul 22, 2002. I have noticed that in many articles, I read, people use a longer method of clearing many textboxes, as well as handling more than one control at the same time.
  • Validation Server Controls in Web FormsAug 05, 2002. When working with Web applications, developers need to write two separate codes using Java Script and VB Script to validate user inputs.In this article we are going to see, how we can reduce the programmers effort on coding, reducing the execution process time and simplify the code handling and less number of lines in the coding.
  • Using Installer Classes to Ease Deployment in VS.NETAug 07, 2002. In this article I will demonstrate how to incorporate installer classes with your Visual Studio .NET msi's to handle any supporting tasks that your assemblies may need.
  • Using Error Provider Control in Windows Forms and C#Oct 08, 2002. In this example we will see how to use the ErrorProvider control in Windows forms to provide validations in Windows Forms and display user-friendly error messages to the user if the validation fails.
  • Drawing Shapes using ThreadingOct 25, 2002. This is simple multi-threading program that draws circles and rectangles. Each shape is handle by individual thread that created every time you press start button. Using sleep method on each thread we can change the speed of each shape.
  • Viewing and Writing XML Data using ADO.NET DataSetsNov 01, 2002. Based on a real world project this article shows how to handle XML data in .NET using C# DataSets and DataViews.
  • Client Server Multithreaded ApplicationNov 08, 2002. This is simple Client/Server (multi-threading) program that transfers data. Server can handle multiple clients.
  • Synchronized Threading in .NETDec 11, 2002. Threads are a powerful abstraction for allowing parallelized operations: graphical updates can happen while another thread is performing computations, two threads can handle two simultaneous network requests from a single process, and the list goes on. Since threads are pretty simple to understand, conceptually, but, practically, they are a cause for programmatic headaches, I decided to write this program to describe how to make use of threads.
  • Lengthy Operations on Single Thread in .NET ApplicationsJul 08, 2003. In this article I discuss how the lenghty operations can be handled in a .NET application. I also discuss how the stack trace can be examined to find any specific methods.
  • Creating ASP.NET Controls DynamicallyJul 10, 2003. This article shows you how create ASP.NET controls dynamically and fill data from a database.
  • Handling Null Values in DataGridJul 17, 2003. This article shows you how to handle no data found or null values in an ASP.NET DataGrid control.
  • Custom Exceptions using Microsoft Exception Management Application BlockSep 02, 2003. This article shows you how to use Microsoft Exception Management Application Block to write custom exceptions.
  • Error Logging in ASP.NETSep 02, 2003. I have written some code that provide your system with some nice features on error logging in ASP.NET.
  • Export ASP.NET DataGrid to ExcelSep 08, 2003. Export to Excel is one of the most common functionality required in ASP.NET pages. Users can download the data from the DataGrid into an Excel spreadsheet for offline verification and/or computation.
  • Enter Null Values for DateTime Column of SQL ServerSep 26, 2003. Inserting a null value to the DateTime Field in SQL Server is one of the most common issues giving various errors. Even if one enters null values the value in the database is some default value as 1/1/1900 12:00:00 AM.
  • Hello World in different StylesJan 09, 2004. I've attempted to write the traditional 'Hello World' in different styles. This explores the different possibilities of addressing a problem - 'Hello World' with different features of C# language and .NET framework.
  • State Management in Web FormsFeb 18, 2004. This white paper discusses the ways in which the state management can be handled in web forms. State management can be done either on client side or server side as explained below.
  • Oracle Data Provider for .NET : Part VIFeb 20, 2004. Oracle Data Provider for .NET (ODP.NET) is an implementation of a data provider for the Oracle database. ODP.NET uses Oracle native APIs to offer fast and reliable access to Oracle data and features from any .NET application.
  • Multilingual Applications in .NETMar 24, 2004. This article explains the basic understanding on different methods of developing multilingual applications in .NET. Here emphasis is given on handling multiple languages using resource files.
  • How to Export Crystal Report in ASP.NETMay 06, 2004. When using Crystal Reports in ASP.NET, the CrystalReportViewer control does not have the export or the print buttons like the one in Windows Form. We can still achieve some degree of export and print functionality by writing our own code to handle exporting.
  • Learning Visual Studio 2005 IDE - The DesignerJun 07, 2004. In this article of Learning Visual Studio 2005 IDE series, I will explore some of the designer features and the breakdown of the classes of a Windows Forms project.
  • Using Tablet PC Ink on Windows ControlsJun 23, 2004. You can use any control as a surface for the ink and can write on these controls using a Tablet PC pen. To make a control ink enabled, you must have to assign the handle of the control to InkOverlay handle.
  • Evolving Register Network using Genetic Algorithms in C# Jun 23, 2004. Genetic Algorithms are powerful AI tools because they can evolve through trial and error and converge into a solution. In this article we will use genetic algorithms to come up with an analog solution.
  • Getting Started With Exception Handling in C#Jul 14, 2004. This article explores exception handling mechanisms in C#, including an explanation of exceptions and why we need to catch exceptions.
  • Handling Oracle Max Open Cursor Error when Fetching Multiple Rows in ADO.NETAug 18, 2004. When working with Microsoft technologies, MS SQL Server comes out as a natural choice for the database. While it is a fact that .NET Framework has extensive support for SQL server, when you work with other databases like Oracle the situation might turn out to be a little more tricky than it is with SQL Server.
  • Logging Errors in a XML FileAug 26, 2004. Error handling and logging errors at a common place is something, which is required in every piece of code you write. The attached source code is an error logger class that I've used in all of my applications. This class writes errors to XML files.
  • Handling the Queuing of Messages in a Multithreaded ProgramSep 06, 2004. In the financial world you have to deal with messages being spewed at you in large quantities at a rapid rate. For example stock quotes, market data, and orders come flying at you through some sort of wire and you as a programmer have to handle them in a way that doesn’t overwhelm you or the machine.
  • CopySchema - Part 2Oct 05, 2004. CopySchema is a utility for copying all the data from one Oracle schema to another. Although similar to the exp/imp and bulk load utilities of Oracle, it has the advantage of offering a simple GUI interface and of handling changes to the schema.
  • CopySchemaOct 05, 2004. CopySchema is a utility for copying all the data from one Oracle schema to another. Although similar to the exp/imp and bulk load utilities of Oracle, it has the advantage of offering a simple GUI interface and of handling changes to the schema.
  • Coloring the Console in C# Oct 25, 2004. When working with console applications in C#, you always see a black and white screen. What if we want to change the background color of the console? We can change the foreground and background color of our console application by using win32 API SetConsoleTextAttribute().
  • Best Practices of Exception ManagementMar 08, 2005. Exception management is one of the key area for all kinds of application development .You should adopt an appropriate strategy for exception management to build high quality and robust application .It is a very powerful concept and makes the development work very easy if its used efficiently.
  • Floating-Point in .NET Part I: Concepts and FormatsApr 18, 2005. The first in a three part series, this article introduces the basic concepts of floating-point arithmetic: number formats, accuracy and precision, and round-off error.
  • Custom Exception Handling in C#May 17, 2005. This article discusses the implementation of Custom Exception Handling using the existing features of C# .Net.
  • Custom Error Handling Using ASP.NETJul 07, 2005. Sometimes in your application, you may want to show some decent error messages other than red error messages and some message when page is not found or server is busy. We will see custom error message handling mechanism in this article using ASP.NET.
  • Swimming with the Sharks : How to Handle Recruiters when Seeking a .NET PositionJul 21, 2005. This article describes how to deal with recruiters in Manhattan, and gives some tips on negotiating for rates and salaries.
  • How do I Implement Custom Event Handling in C#Oct 27, 2005. In this article, we are going to show, how we can call custom event on our designed conditions.
  • Navigating Data Grid using Client ScriptingNov 10, 2005. It's very common practice to use the Data Grid to present data over web pages. Though the Data Grid is provides the richer UI presentation if not coded and handled effectively it can have great performance issues. This article gives the code sample for navigating the data grid using the Client Scripting (thereby can be used for lots of validation before doing the Post Back to the server) and minimizing the round trip to server
  • Better Exception Handling in Visual Studio 2005Nov 16, 2005. With many new cool features, components, controls, and tools, Visual Studio 2005 definitively is a winner. In this article, I discuss the new exception handling dialog in Visual Studio 2005.
  • How to Overcome Error "Access to the Path Containing 'hash.web' is Getting Denied."Jan 08, 2006. The article is about how to overcome with the error that reads "Access to the path containing 'hash.web' is getting denied."
  • Understanding C# Events: What They Are and Where They Came FromJan 30, 2006. To help you get a working knowledge of C# events and event handling, this article explains where events come from, what they really are at a functional level and how they are expressed in C#. This article specifically looks at the Gang Of Four (GOF) Observer pattern.
  • Auditing and Logging ExceptionsFeb 01, 2006. This article shows how to handle a SQL Server error condition by using the SQL Server .NET Framework data provider.
  • Exception ManagementFeb 02, 2006. Correct exception handling in your Web pages prevents sensitive exception details from being revealed to the user. The following recommendations apply to ASP.NET Web pages and controls.
  • File uploader in C#Feb 13, 2006. This article shows a simple Web user control for uploading any file up to 2 MB to the specified folder using C#.
  • Customized Exception Handling Using Resource FileMar 03, 2006. A good exception handling should care about user as well as developer. i.e. developer can easily locate the exception entry point, may be a function or any where in a vast project, and fix it as soon as possible. So in this writing I tried some exception handlings which will consider both user and developer.
  • OnChanged Event for User ControlsMay 09, 2006. In this article I will show some ways how to create user controls with OnChanged event . The examples are written using C# for Windows applications.
  • The request failed with HTTP status 401: Access DeniedJun 30, 2006. An unhandled exception occurred during the execution of the current Web request. Please review the stack trace for more information about the error and where it originated in the code.
  • The database DLL 'crdb_adoplus.dll' could not be loaded.Aug 01, 2006. Failed to load database information. Details: The database DLL 'crdb_adoplus.dll' could not be loaded.
  • Handling new line and carriage return with TextboxAug 08, 2006. This article shows how to handle newline and carriage return with Textbox while working with Databases.
  • Using Delegates to Communication Between Windows FormsSep 04, 2006. Delegates are one of the wonderful features of .Net Framework. Their primary use is focused on support event handling and callback mechanism. In this article we will explore how to use delegate as callback support to make simple communication between deferent opened windows forms
  • User Confirmation before Deleting Items in ASP.Net 2.0Oct 12, 2006. This article describes how ASP.Net 2.0 allows setting client-side functions for Button controls through the use of the OnClientClick property and additionally, the event can be handled on server-side depending on the user response.
  • Event and Error LoggingDec 15, 2006. This article describes an approach to writing to a custom error log and to writing events into the system event log.
  • Extend the Textbox Control to Validate Against Regular ExpressionsJan 05, 2007. This article describes an approach to validating text box entries against a regular expression.
  • The GOF "Chain of Responsibility" Design PatternJan 18, 2007. The Chain of Responsibility pattern is used to pass responsibility for handling a call to another class. This article gives a basic overview of the pattern.
  • HTTP:/1.1 500 Internal Server ErrorFeb 09, 2007. If you are running two versions of ASP.NET, you may get HTTP:/1.1 500 Internal Server Error when creating a new Web project or opening an existing Web project in Visual Studio.
  • Cannot perform '>' operation on System.DateTime and System.DoubleFeb 22, 2007. I get error "Cannot perform '>' operation on System.DateTime and System.Double" when applying a filter on DataView.
  • Error Provider in C#Mar 09, 2007. This article shall address the use of the error provider control in Win Forms application development. The error provider control is most useful in displaying errors associated with data entry tasks on a Windows form.
  • Concurrency violation: the UpdateCommand affected 0 records. Mar 27, 2007. When you use a DataAdapter object to write changes back to a database by means of a stored procedure, you may receive the following error message: Additional information: Concurrency violation: the UpdateCommand affected 0 records.
  • Aspnet_wp.exe was recycled errorMar 27, 2007. Occasionally, slow writes to a client cause Aspnet_wp to recycle on false deadlocks, which generates this error in event log.
  • Web Access Failed Error Mar 30, 2007. Web Access Failed Error Message When You Use Visual Studio .NET with IIS 6.0 to Create an ASP.NET Web Application.
  • ASP.Net 2.0: Export GridView to Excel - Part IIApr 04, 2007. In this version of the article, we will include the handling the Hyperlink columns in the GridView export to Excel and also re-factor our original logic to use more general features of Reflection.
  • Debugging Windows Forms Run-Time Error 101 Using C#Apr 11, 2007. This article will give you step-by-step introduction to debug Windows Forms application run-time error using C#.
  • Multi-threaded Asynchronous Programming in C#. Async Database Calls. Part III.May 14, 2007. In my last couple articles we looked at basic ways to have long-running i/o bound process be handled by the ThreadPool using the asynchronous programming model. In this article we’ll take a look at coding async calls against SqlServer which really comes in handy in production environments where our database is on another machine.
  • Error handler for web applicationsMay 15, 2007. In this article I will describe the error handler for ASP.NET 2.0 applications, that is developed in a separate class library project . You can use it in any web application you want by adding a reference to the compiled dll assembly without writing many lines of code. The examples are written using C#.
  • Error Opening SSIS PackageMay 30, 2007. I got a weird error when trying to open an SSIS package in VS2005.
  • Exception Handling in VB.NETJun 25, 2007. Exception handling is crucial since the robustness of software depends on how effectively a program deals with exceptions.
  • Generic Error Logger using ASP.Net & C#Jul 09, 2007. In this article I just want to put some light on "global.asax" file & how we can make use of "Application_Error".
  • Connection PoolingAug 11, 2007. While performing any database activity it is necessary that every single connection need to be closed, but in case your application throws some exception in that case our connection wont’ get closed. And you will get error “Cannot open connection, it is already open” In this article I will be discussing what is connection pooling? Why connection polling & how we can enable connection pooling etc.
  • Free Book: C# Programming for BeginnersAug 21, 2007. In this book, you will learn how to write and compile C# programs, understand C# syntaxes, data types, control flow, classes and their members, interfaces, arrays, and exception handling. After completing this book, you should have a clear understanding of the purpose of C# language, it’s usages, and how to write C# programs.
  • Solution for "A Graphics Object cannot be Created from an Image that has an Indexed Pixel Format"Sep 10, 2007. In this article, you can learn how to avoid the issues/errors when you access/edit indexed pixel format images using few steps.
  • XML with C-sharpSep 13, 2007. Through this article you will learn how to handle XML in c#.
  • Best Practices for handling exceptionsSep 18, 2007. This article shall explain some of the best practices when you deal with exceptions.
  • AJAX AutoCompleteExtenderOct 04, 2007. In one of the Ajax project while using <ajaxToolkit: AutoCompleteExtender> I was getting following error: Error Creating control - autoComplete1. This control cannot be displayed because it's tag prefix is not registered in the web form.
  • Exception Handling in WCF using Fault ContractJan 03, 2008. This article demonstrates how to get error information from a service to a client using fault contract in WCF.
  • Writing Better Code - Keepin' it ExtensibleFeb 21, 2008. In a previous article I talked about how to keep code cohesive by applying the Single Responsibility Principle. I wanted to explore part of another principle of software engineering that will help our code be extensible and can handle growth and change.

About error-handling

NA

SPONSORED BY

Spire.Doc - Free .NET Word API
Use Spire.Doc to create, read, write, print, and convert word documents to OpenXML, RTF, TXT, XPS, EPUB, EMF, HTML, Image and PDF.
European SharePoint Conference