You are here

Application Development

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). 

SqlConnectionStringBuilder

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.

DELETE  c1

FROM    dbo.contact c1

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

                        FROM    dbo.contact

                        GROUP   BY emailaddress

                        HAVING  COUNT(*) > 1

            ) c2 ON c1.emailaddress = c2.emailaddress

WHERE   c1.contactid > c2.contactid

About the Author:

DbProviderFactory GetConnection

With the new ADO.NET 2.0 DbProviderFactory and DbProviderFactories classes, you can change the database provider at runtime.  The DbProviderFactories class is use to create a factory object, which in turn is use to create the appropriate provider objects (connection, command, dataadapter, etc).  Here's an example that returns a DbConnection object based on the name of the connection string in the Web.config file.

/// <summary>

/// Create generic database connection object using new DbProviderFactories class.

Pages