You are here

Application Development

Find Items In A Generic List

Ken Getz wrote a good article titled Predicates and Actions about the advantage of the new generic features in .NET 2.0 Framework.  One issue I ran into using predicates was passing an argument to use as the filter.  For example, in the callback method Match() below, the predicate searches the states generic list for those that start with “C”, but the string to search for is hardcoded because the predicate signature only allows for one argument that is of the same type as the items in the generic list.

New Term Trial Ballon: A "CSP" like an "ISP", where CSP = Computecycles Service Provider

A special kind of cloud and cloud-related provider, operates like an ISP in the he/she must be near enough to its clients to he/she can get a least 10 MBit Ethernet speed (glass to the doorstep).  But then, all he/she offers is virtual servers and the like, so that nearby companies can totally outsource everything in their environment except a router and some thin clients, if that all they need.  They can get Windows, exchange Linux, SQL server, cloud stuff, data storage, they can event rent the MS apps like word from the CSP, and avoid the licensing noise with MS. Backup = solved.

Current ASPX Page Name

Get the name of the current ASP.NET page.

string path = System.Web.HttpContext.Current.Request.Url.AbsolutePath; string name = System.IO.Path.GetFileName( path );

About the Author:

Handling Multiple Events With A Delegate

In a recent multi-tab VB.NET Web application, the values from a 3 controls on a tab (tab A) were used as filters for a dropdownlist on a subsequent tab (tab B).  If the controls on tab A were changed, the dropdownlist on tab B would be reloaded based on the changed value(s). 


Occasionally there's a need to construct a new connection string from user input instead of using a predefined one from the Web.Config file.  Using the SqlConnectionStringBuilder class, a new connection string can be constructed easily without resorting to string concatenations. private string BuildConnectionString() {     SqlConn

Injecting JavaScript from an Ajax Update Panel

I started using the Update Panel control recently to verify that an email address entered on a registration form was not a duplicate.  If the email address as a duplicate, I wanted to display a simply JavaScript alert to notify the user without resorting to hidden fields.  After much searching  I found the The

Remove Duplicate Records

The following is one approach to removing duplicate records from a table assuming the first entry is the one to keep.



            INNER JOIN( SELECT  emailaddress, MIN(contactid) AS contactid


                        GROUP   BY emailaddress

                        HAVING  COUNT(*) > 1

            ) c2 ON c1.emailaddress = c2.emailaddress

WHERE   c1.contactid > c2.contactid

About the Author: