.NET news » Examples Examples Rss Feed

ADO.NET Examples and Best Practices for C# Programmers
Author: William R. Vaughn
Average rating:  / 0
(0 reviews)
More .NET Examples books

Design Patterns - nuff said !

Principles of Design Patterns to answer why they exist, who should actually use them and their learning roadmap for beginners (using C#)
2 Sep 2010, 23:20:00   Source: Design Patterns - nuff said !   Tags: Examples

Displaying Files and Folders in a GridView

The .NET Framework provides a variety of classes in the System.IO namespace that simplify working with the file system. Using these classes it's possible to delete files and folders, to create new files, to edit existing files, and more. These classes, combined with ASP.NET's suite of Web controls and databinding syntax, make it quite easy to present information about the files on the web server's file system to visitors to your website. With a bit of markup and code, it's possible to add a simple file browser to a web page that allows users to view the files and folders from a particular directory on the web server. Such file browsers are useful if you let users upload content to the website and need to let them view their uploaded content. If you have a folder that contains user-accessible content like images, PDF files and Word documents, a file browser offers a quick and easy way for users to see what content is available and to view content of interest.

Back in 2003 I wrote an article titled Displaying the Files in a Directory using a DataGrid that showed how to list the files of a particular folder in a DataGrid Web control. This dated article still attracts a decent amount of traffic and questions from readers, so much so that I thought it worthwhile to update the content to use the latest technology, namely ASP.NET 4 and the GridView Web control. I also added some new features. For example, the file browser now lists both files and folders, allowing users to view the files in subfolders. Also, I moved the markup and code into a User Control, which simplifies adding the file browser to an ASP.NET page. This article walks through this new, updated version; the complete, working code is available for download at the end of this article.

31 Aug 2010, 19:00:00   Source: Displaying Files and Folders in a GridView   Tags: Examples

Dynamically Loading Silverlight Video Players using MEF

An example using MEF to dynamically load Silverlight Video Players
25 Aug 2010, 01:05:00   Source: Dynamically Loading Silverlight Video Players using MEF   Tags: Examples

The Baker’s Dozen: 13 More Examples of Functionality in SQL Server 2008 Integration Services

In the last Baker’s Dozen article, I demonstrated 13 SSIS packages to show what Integration Services can do. This article picks up where the last one left off. I’ll show some capabilities in SSIS, such as handling irregular input files, extracting database changes, implementing package configurations, and leveraging the advanced lookup features in SSIS 2008.

22 Aug 2010, 19:00:00   Source: The Baker’s Dozen: 13 More Examples of Functionality in...   Tags: Examples

Generic Alert Handler - A Practical Example on Multithreading

With the help of an example in this article, I have tried to explain a practical multi-threading application design. The Microsoft CLR Profiler tool has been used to get an insight on what is going on. Emphasis is given to development of a generic module as it maximizes code reuse.
17 Aug 2010, 17:22:00   Source: Generic Alert Handler - A Practical Example on...   Tags: Examples

Develop your own language translation system

Understanding of Example Based Machine Translation (EBMT) system and how to create your own using exisiting tools
11 Aug 2010, 01:50:00   Source: Develop your own language translation system   Tags: Examples

Filtering Data Using ASP.NET 4's QueryExtender Control

One of the new controls available with ASP.NET 4 is the QueryExtender control. The QueryExtender is designed to simplify filtering data returned from a LinqDataSource or EntityDataSource by decoupling the filtering logic from the data source control. Using the QueryExtender is easy - simply add a QueryExtender to the page, specify what data source control it applies to, and then define the filtering criteria. For example, when displaying product information on a web page you could use the QueryExtender control and a few lines of markup to display only those products that are not within a certain price range and whose name or category starts with a user-specified search string.

Filtering the data returned by a LinqDataSource or EntityDataSource control is certainly possible without the QueryExtender; both the LinqDataSource and EntityDataSource controls have a Where property that can be used to specify filtering criteria. What the QueryExtender offers is a simpler means by which to filter data. This article includes a number of demos (which can be downloaded at the end of this article) that showcase the QueryExtender's ease of use and its powerful filtering capabilities.

10 Aug 2010, 19:00:00   Source: Filtering Data Using ASP.NET 4's QueryExtender Control   Tags: Examples

Font Survey: 42 of the Best Monospaced Programming Fonts

This article presents commonly used programming fonts with examples of each font in ClearType and non-ClearType.
6 Aug 2010, 09:44:00   Source: Font Survey: 42 of the Best Monospaced Programming Fonts   Tags: Examples

Defining Descriptive Text for Enumeration Members

An enumeration is a special type in the .NET Framework that is comprised of a number of named constants. While you might not have created an enumeration type yourself, you have likely used enumerations many times in day-to-day programming. For example, the rows in a GridView have a RowType property that returns an enumeration of type DataControlRowType that indicates the row's type: Header, Footer, DataRow, and so on.

When working with an enumeration we may need to display a descriptive message based on the enumeration's value. For example, using ASP.NET's Membership system you can programmatically create a new user account calling the Membership class's CreateUser method. This method specifies the success or failure of the operation via the MembershipCreateStatus enumeration. This enumeration has members like Success, InvalidUserName, InvalidPassword, DuplicateUserName, and the like. When calling this method from an ASP.NET page you might want to show the user a descriptive message based on this enumeration value.

This article explores three different ways to provide descriptive text for enumeration members.

3 Aug 2010, 19:00:00   Source: Defining Descriptive Text for Enumeration Members   Tags: Examples

How I explained Design Patterns to my wife : Part 1

Learning Object Oriented Design Patterns through some interesting conversations
3 Aug 2010, 09:56:00   Source: How I explained Design Patterns to my wife : Part 1   Tags: Examples