<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30284608</id><updated>2012-02-16T03:00:28.743-08:00</updated><category term='C#'/><category term='MSSQL'/><category term='MSSQL 2008'/><category term='Microsoft'/><category term='File Dialog'/><category term='Javascript'/><category term='bug'/><category term='MS Outlook'/><category term='GridView'/><category term='ASP .NET'/><category term='AJAX'/><category term='Winform'/><category term='VB.NET'/><category term='Autoresponder'/><category term='Error'/><category term='Problems with System.Web.Abstraction dll'/><category term='Events'/><category term='Service Broker'/><category term='MSSQL Import Error'/><category term='ASP.NET'/><category term='.NET'/><category term='USB malfuntion'/><category term='Login'/><title type='text'>Programming Gems</title><subtitle type='html'>A blog about commonly used programming data information for quick refreshing of memory.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30284608.post-8395084513844849175</id><published>2011-02-21T22:11:00.000-08:00</published><updated>2011-02-21T22:26:20.527-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='USB malfuntion'/><title type='text'>USB devices attached to this computer has malfunctioned</title><content type='html'>This problem drove my IT support nuts, but there is a simple way 5 steps process to resolve the problem:&lt;br /&gt;&lt;br /&gt;1. Disconnect all USB devices from the computer.&lt;br /&gt;2. Go to BIOS and set USB as the 1st to load. This will make sure the device driver is loaded before Windows start.&lt;br /&gt;3. Go to Windows in Safe mode - this will load all the device drivers again.&lt;br /&gt;4. Switch off your computer for 30 mins so that the last faulty USB error memory that is stored in BIOS is cleared.&lt;br /&gt;5. Restart your computer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This works for all the cases of this problem I have found so far.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-8395084513844849175?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/8395084513844849175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2011/02/usb-devices-attached-to-this-computer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8395084513844849175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8395084513844849175'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2011/02/usb-devices-attached-to-this-computer.html' title='USB devices attached to this computer has malfunctioned'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2239460286703701214</id><published>2010-08-26T02:39:00.000-07:00</published><updated>2010-08-26T02:41:49.815-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL 2008'/><title type='text'>Saving Changes is not Permitted. The changes you made requires the table to be dropped and recreated...</title><content type='html'>One of the new things that happens in SQL Server 2008 is that it prevents saving table structure changes that require the table to be dropped and re-created. While this is a great feature to prevent accidents from occurring, on a developer machine it can be quite frustrating. This is the dialog you get when trying to make changes in a table design.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Unfortunately, this dialog doesn’t tell you where to turn this feature off! Clicking on the small “?” on the title bar does get you to a help page that tells you how to do it.&lt;br /&gt;&lt;br /&gt;Anyway, the place to do it is Tools &gt; Options &gt; Designers &gt; Table and Database Designers &gt; Prevent saving changes that require table re-creation. Turn this option off and you will be able to save the tables again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2239460286703701214?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2239460286703701214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2010/08/saving-changes-is-not-permitted-changes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2239460286703701214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2239460286703701214'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2010/08/saving-changes-is-not-permitted-changes.html' title='Saving Changes is not Permitted. The changes you made requires the table to be dropped and recreated...'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-4882062138888673090</id><published>2009-05-28T18:37:00.000-07:00</published><updated>2009-05-28T18:40:08.616-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL Import Error'/><title type='text'>SQL Server 2005: Importing from Excel error 0xc020901c</title><content type='html'>Error 0xc020901c: Data Flow Task: There was an error with output column "Agenda 2" (63) on output "Excel Source Output" (9). The column status returned was: "Text was truncated or one or more characters had no match in the target code page.".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;To fix the problem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To change the value of TypeGuessRows, use these steps:&lt;br /&gt;&lt;/li&gt;&lt;li&gt;On the Start menu, click Run. In the Run dialog box, type Regedt32, and then click OK.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Open the following key in the Registry editor:&lt;br /&gt;&lt;br /&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel&lt;/li&gt;&lt;li&gt;Double-click TypeGuessRows.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In the DWORD editor dialog box, click Decimal under Base. Type a value between 0 &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click OK, and then exit the Registry Editor.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/281517/EN-US/"&gt;http://support.microsoft.com/kb/281517/EN-US/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-4882062138888673090?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/4882062138888673090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/05/sql-server-2005-importing-from-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4882062138888673090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4882062138888673090'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/05/sql-server-2005-importing-from-excel.html' title='SQL Server 2005: Importing from Excel error 0xc020901c'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-5841821765792115292</id><published>2009-05-13T20:05:00.000-07:00</published><updated>2009-08-02T20:29:48.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to Close Web Browsers</title><content type='html'>btn.Attributes.Add("OnClick", "self.close()");&lt;br /&gt;will do the trick.&lt;br /&gt;Another alternative is&lt;br /&gt;Response.Write (" &amp;lt; script &amp;gt;  self.close() ; &amp;lt; /script &amp;gt;&lt;br /&gt;");&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-5841821765792115292?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/5841821765792115292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/05/how-to-close-web-browsers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/5841821765792115292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/5841821765792115292'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/05/how-to-close-web-browsers.html' title='How to Close Web Browsers'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2425654526211221392</id><published>2009-04-22T18:58:00.001-07:00</published><updated>2009-04-28T23:11:30.566-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>DataBase could not be exclusively Locked when renaming a database</title><content type='html'>The problem is due to other users using the database. To resolve the problem, you set the database to be used only by yourself. After the rename operation, you need to reset it back to be usable by other users. It is a common courtesy to inform all users prior to doing this operation.&lt;br /&gt;&lt;br /&gt;ALTER DATABASE &lt;strong&gt;&lt;span style="color:#cc0000;"&gt;DBNAME&lt;/span&gt;&lt;/strong&gt; SET SINGLE_USER WITH ROLLBACK IMMEDIATE&lt;br /&gt;GO&lt;br /&gt;SP_RENAMEDB @dbname = &lt;span style="color:#cc0000;"&gt;&lt;strong&gt;'old_name' ,&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;@newname = &lt;span style="color:#cc33cc;"&gt;&lt;strong&gt;'new_name'&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;Go&lt;br /&gt;ALTER DATABASE &lt;strong&gt;&lt;span style="color:#cc33cc;"&gt;NEWDBNAME&lt;/span&gt;&lt;/strong&gt; SET MULTI_USER -- set back to multi user&lt;br /&gt;GO&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2425654526211221392?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2425654526211221392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/04/database-could-not-be-exclusively.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2425654526211221392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2425654526211221392'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/04/database-could-not-be-exclusively.html' title='DataBase could not be exclusively Locked when renaming a database'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-3051625323210286668</id><published>2009-03-16T19:53:00.000-07:00</published><updated>2009-03-16T19:56:37.757-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to Sort or handle Paging in GridView Manually without databinding</title><content type='html'>The GridView 'GridViewID' fired event PageIndexChanging which wasn't handled.&lt;br /&gt;The GridView 'GridViewID' fired event Sorting which wasn't handled.&lt;br /&gt;&lt;br /&gt;private string ConvertSortDirectionToSql(SortDirection sortDirection)&lt;br /&gt;    {&lt;br /&gt;        string newSortDirection = String.Empty;&lt;br /&gt;&lt;br /&gt;        switch (sortDirection)&lt;br /&gt;        {&lt;br /&gt;            case SortDirection.Ascending:&lt;br /&gt;                newSortDirection = "ASC";&lt;br /&gt;                break;&lt;br /&gt;&lt;br /&gt;            case SortDirection.Descending:&lt;br /&gt;                newSortDirection = "DESC";&lt;br /&gt;                break;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        return newSortDirection;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)&lt;br /&gt;    {&lt;br /&gt;        GridViewSortExpression = e.SortExpression;&lt;br /&gt;        int pageIndex = this.GridView1.PageIndex;&lt;br /&gt;        this.GridView1.DataSource = SortDataTable(GridView1.DataSource as DataTable, false);&lt;br /&gt;        this.GridView1.DataBind();&lt;br /&gt;        this.GridView1.PageIndex = pageIndex;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private string GridViewSortDirection&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return ViewState["SortDirection"] as string ?? "ASC";&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            ViewState["SortDirection"] = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    private string GridViewSortExpression&lt;br /&gt;    {&lt;br /&gt;        get&lt;br /&gt;        {&lt;br /&gt;            return ViewState["SortExpression"] as string ?? string.Empty;&lt;br /&gt;        }&lt;br /&gt;        set&lt;br /&gt;        {&lt;br /&gt;            ViewState["SortExpression"] = value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    private string GetSortDirection()&lt;br /&gt;    {&lt;br /&gt;        switch (GridViewSortDirection)&lt;br /&gt;        {&lt;br /&gt;            case "ASC":&lt;br /&gt;                GridViewSortDirection = "DESC";&lt;br /&gt;                break;&lt;br /&gt;            case "DESC":&lt;br /&gt;                GridViewSortDirection = "ASC";&lt;br /&gt;                break;&lt;br /&gt;        }&lt;br /&gt;        return GridViewSortDirection;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)&lt;br /&gt;    {&lt;br /&gt;        this.GridView1.DataSource = SortDataTable(this.GridView1.DataSource as DataTable, true);&lt;br /&gt;        this.GridView1.PageIndex = e.NewPageIndex;&lt;br /&gt;        this.GridView1.DataBind();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    protected DataView SortDataTable(DataTable dataTable, bool isPageIndexChanging)&lt;br /&gt;    {&lt;br /&gt;        if (dataTable != null)&lt;br /&gt;        {&lt;br /&gt;            DataView dataView = new DataView(dataTable);&lt;br /&gt;            if (GridViewSortExpression != string.Empty)&lt;br /&gt;            {&lt;br /&gt;                if (isPageIndexChanging)&lt;br /&gt;                {&lt;br /&gt;                    dataView.Sort = string.Format("{0} {1}", GridViewSortExpression, GridViewSortDirection);&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    dataView.Sort = string.Format("{0} {1}", GridViewSortExpression, GetSortDirection());&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            return dataView;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            return new DataView();&lt;br /&gt;        }&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-3051625323210286668?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/3051625323210286668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/03/how-to-sort-or-handle-paging-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3051625323210286668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3051625323210286668'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/03/how-to-sort-or-handle-paging-in.html' title='How to Sort or handle Paging in GridView Manually without databinding'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-916607330359589571</id><published>2009-03-16T19:28:00.000-07:00</published><updated>2009-03-16T19:34:37.007-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to have Display Number in GridView</title><content type='html'>&lt; asp:TemplateField &gt;&lt;br /&gt;&lt; ItemTemplate &gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&lt; %# Container.DataItemIndex + 1 % &gt;&lt;/span&gt;&lt;br /&gt;&lt; /ItemTemplate &gt;&lt;br /&gt;&lt; /asp:TemplateField &gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-916607330359589571?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/916607330359589571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/03/how-to-have-display-number-in-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/916607330359589571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/916607330359589571'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/03/how-to-have-display-number-in-gridview.html' title='How to have Display Number in GridView'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-1158205429760697424</id><published>2009-03-10T18:41:00.000-07:00</published><updated>2009-03-10T18:42:26.501-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started..</title><content type='html'>The error that you are getting is because your StateServer is not enabled. You have to go to AdministrativeTools &gt; Computer Management &gt; Services and Applications &gt;Services and start the ASP.NET State Service&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-1158205429760697424?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/1158205429760697424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/03/unable-to-make-session-state-request-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1158205429760697424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1158205429760697424'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/03/unable-to-make-session-state-request-to.html' title='Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started..'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2494557519242717906</id><published>2009-03-10T18:36:00.000-07:00</published><updated>2009-03-10T18:43:26.938-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Service Broker'/><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported...</title><content type='html'>This problem frequently occurs when you just restored a database, but service brokers are broken or lost.&lt;br /&gt;&lt;br /&gt;To resolve this problem.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;alter database xxxx set NEW_BROKER&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Alternatively,&lt;br /&gt;&lt;br /&gt;1. Go to Programs -&gt; Microsoft Sql Server 2005 -&gt; Configuration Tools -&gt; Sql Server Surface Area Configuration -&gt; Surface Area Configuration for Features.&lt;br /&gt;2. Locate "Service Broker" under the database engine and enable it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2494557519242717906?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2494557519242717906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/03/sql-server-service-broker-for-current.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2494557519242717906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2494557519242717906'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/03/sql-server-service-broker-for-current.html' title='The SQL Server Service Broker for the current database is not enabled, and as a result query notifications are not supported...'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-3232415256271137413</id><published>2009-03-08T21:06:00.000-07:00</published><updated>2009-03-08T21:11:05.048-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Problems with System.Web.Abstraction dll'/><title type='text'>Could not load file or assembly 'System.Web.Abstractions, Version=3.5.0.0, Culture=neutral,</title><content type='html'>To resolve this problem&lt;br /&gt;&lt;br /&gt;1. Download and Install .NET Framework 3.5 SP1 at&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/thankyou.aspx?familyId=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displayLang=en"&gt;http://www.microsoft.com/downloads/thankyou.aspx?familyId=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;amp;displayLang=en&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Download and install ASP.NET MVC Release Candidate 2&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ee4b2e97-8a72-449a-82d2-2f720d421031&amp;amp;displaylang=en#filelist"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=ee4b2e97-8a72-449a-82d2-2f720d421031&amp;amp;displaylang=en#filelist&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3. Check that the 3 dlls are in the bin folder. Your application should work ;)&lt;br /&gt;System.Web.Abstractions&lt;br /&gt;System.Web.Routing&lt;br /&gt;System.Web.Mvc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-3232415256271137413?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/3232415256271137413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2009/03/could-not-load-file-or-assembly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3232415256271137413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3232415256271137413'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2009/03/could-not-load-file-or-assembly.html' title='Could not load file or assembly &apos;System.Web.Abstractions, Version=3.5.0.0, Culture=neutral,'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2558496746618250452</id><published>2008-11-26T23:49:00.001-08:00</published><updated>2008-11-27T00:05:15.974-08:00</updated><title type='text'>How to get rid of "Warning as an Error" message</title><content type='html'>In the web config file, added the following add in Red under the compilers section for each compiler you have.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#006600;"&gt;&amp;lt;compilers&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&amp;lt;providerOption name="WarnAsError" value="false"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&amp;lt;/compiler&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/compilers&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2558496746618250452?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2558496746618250452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/11/how-to-get-rid-of-warning-as-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2558496746618250452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2558496746618250452'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/11/how-to-get-rid-of-warning-as-error.html' title='How to get rid of &quot;Warning as an Error&quot; message'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-1020511752350513243</id><published>2008-11-26T23:45:00.001-08:00</published><updated>2008-11-26T23:47:38.841-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VB.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)</title><content type='html'>To resolve this problem, please ensure that you have the system.web.extension dll added as a reference in your project.&lt;br /&gt;&lt;br /&gt;Alternatively, copying the system.web.extension.dll to the bin directory for a deployment project should resolve the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-1020511752350513243?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/1020511752350513243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/11/type-or-namespace-name-script-does-not.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1020511752350513243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1020511752350513243'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/11/type-or-namespace-name-script-does-not.html' title='The type or namespace name &apos;Script&apos; does not exist in the namespace &apos;System.Web&apos; (are you missing an assembly reference?)'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-3722038498363654481</id><published>2008-11-05T19:40:00.000-08:00</published><updated>2008-11-05T19:45:39.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='File Dialog'/><category scheme='http://www.blogger.com/atom/ns#' term='Winform'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to Show File Dialog</title><content type='html'>Here is some code to allow users to select Folder.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;public class FolderBrowser : FolderNameEditor&lt;br /&gt;{&lt;br /&gt;private FolderNameEditor.FolderBrowser m_obBrowser = null;&lt;br /&gt;private string m_strDescription;&lt;br /&gt;public FolderBrowser()&lt;br /&gt;{&lt;br /&gt;m_strDescription = "Select folder";&lt;br /&gt;m_obBrowser = new FolderNameEditor.FolderBrowser();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string DirectoryPath&lt;br /&gt;{&lt;br /&gt;get{return this.m_obBrowser.DirectoryPath;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public DialogResult ShowDialog()&lt;br /&gt;{&lt;br /&gt;m_obBrowser.Description = m_strDescription;&lt;br /&gt;return m_obBrowser.ShowDialog();&lt;br /&gt;}&lt;br /&gt;} &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-3722038498363654481?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/3722038498363654481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/11/how-to-show-file-dialog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3722038498363654481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3722038498363654481'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/11/how-to-show-file-dialog.html' title='How to Show File Dialog'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-8106599870889233274</id><published>2008-07-16T18:19:00.000-07:00</published><updated>2008-11-05T19:47:30.025-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSSQL'/><title type='text'>How to Restore a MSSQL backup (.bak)</title><content type='html'>Run the command in MSSQL to restore a .bak file&lt;br /&gt;&lt;br /&gt;RESTORE DATABASE [abc]&lt;br /&gt;FROM DISK = 'C:\backup_200807102327.bak'&lt;br /&gt;with move 'abc' to 'C:\Database\abc.mdf',&lt;br /&gt;move 'abc_LOG' to 'C:\Database\abc.LOG',&lt;br /&gt;Replace&lt;br /&gt;GO&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-8106599870889233274?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/8106599870889233274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/07/how-to-restore-mssql-backup-bak.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8106599870889233274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8106599870889233274'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/07/how-to-restore-mssql-backup-bak.html' title='How to Restore a MSSQL backup (.bak)'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-4928046187119503964</id><published>2008-06-30T19:49:00.000-07:00</published><updated>2008-11-05T19:47:54.652-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to sort and allow paging manually using Gridview</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;private string&lt;/span&gt; ConvertSortDirectionToSql(&lt;span style="color:#008080;"&gt;SortDirection&lt;/span&gt; sortDirection)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt; newSortDirection = &lt;span style="color:#008080;"&gt;String&lt;/span&gt;.Empty;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;switch&lt;/span&gt; (sortDirection)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;case&lt;/span&gt; &lt;span style="color:#008080;"&gt;SortDirection&lt;/span&gt;.Ascending:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;newS&lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;ortDirection = &lt;span style="color:#a52a2a;"&gt;"ASC"&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;break&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;case&lt;/span&gt; &lt;span style="color:#008080;"&gt;SortDirection&lt;/span&gt;.Descending:&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;newS&lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;ortDirection = &lt;span style="color:#a52a2a;"&gt;"DESC"&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#0000ff;"&gt;break&lt;/span&gt;;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;newS&lt;/span&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;ortDirection;&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;protected void&lt;/span&gt; gridView_PageIndexChanging(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#008080;"&gt;GridViewPageEventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;gridView.PageIndex = e.NewPageIndex;&lt;br /&gt;gridView.DataBind();&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;protected void&lt;/span&gt; gridView_Sorting(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color:#008080;"&gt;GridViewSortEventArgs&lt;/span&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#008080;"&gt;DataTable&lt;/span&gt; dataTable = gridView.DataSource &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; &lt;span style="color:#008080;"&gt;DataTable&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (dataTable != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#008080;"&gt;DataView&lt;/span&gt; dataView = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#008080;"&gt;DataView&lt;/span&gt;(dataTable);&lt;br /&gt;dataView.Sort = e.SortExpression + &lt;span style="color:#a52a2a;"&gt;" "&lt;/span&gt; + ConvertSortDirectionToSql(e.SortDirection);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;gridView.DataSource = dataView;&lt;br /&gt;gridView.DataBind();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-4928046187119503964?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/4928046187119503964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-sort-and-allow-paging-manually.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4928046187119503964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4928046187119503964'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-sort-and-allow-paging-manually.html' title='How to sort and allow paging manually using Gridview'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-8952716996408149497</id><published>2008-06-26T03:13:00.000-07:00</published><updated>2008-11-05T19:55:39.267-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to have a pop out dialog box in ASP.NET</title><content type='html'>&lt;span style="font-family:Verdana;font-size:85%;"&gt;JHaIn all good web applications, the user is asked to confirm whether he/she wants to delete something in case the delete button was pressed accidentally.&lt;br /&gt;&lt;br /&gt;Although it seems like a pain to do, it is actually really easy if you find it acceptable to use javascript's “confirm” statement, which will popup a dialog box with a particular question with “ok” and “cancel” buttons. You have no control of the title of the popup, but in IE it says “Microsoft Internet Explorer“ and I believe it says “[Javascript Application]“ or similar in Firebird.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.davidhayden.com/photos/popup.gif" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The javascript code for it is simple:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function confirm_delete()&lt;br /&gt;{&lt;br /&gt;if (confirm("Are you sure you want to delete the custom search?")==true)&lt;br /&gt;return true;&lt;br /&gt;else&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using code-behind, you can attach the javascript popup dialog to the button:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;_myButton.Attributes.Add("onclick", "return confirm_delete();");&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;When you click on the delete button, the javascript popup dialog asks if you want to delete the search. If you choose “cancel“, your “DeleteSearch_Click” event is never fired. If you choose “ok”, the event is fired and you can delete the item.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-8952716996408149497?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/8952716996408149497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-have-pop-out-dialog-box-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8952716996408149497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/8952716996408149497'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-have-pop-out-dialog-box-in.html' title='How to have a pop out dialog box in ASP.NET'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2656758892102082638</id><published>2008-06-26T01:48:00.000-07:00</published><updated>2008-11-05T19:56:08.602-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><title type='text'>How to Select a Row in GridView without using select button</title><content type='html'>&lt;?xml:namespace prefix = asp /&gt;&lt;asp:gridview id="MyGridView" runat="server" onrowdatabound="MyGridView_RowDataBound" onselectedindexchanged="MyGridView_SelectedIndexChanged"&gt;&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;&lt;/asp:gridview&gt;&lt;br /&gt;&lt;br /&gt;protected void MyGridView_RowDataBound(object sender, GridViewRowEventArgs&lt;br /&gt;e)&lt;br /&gt;{&lt;br /&gt;if (e.Row.RowType == DataControlRowType.DataRow)&lt;br /&gt;{&lt;br /&gt;e.Row.Attributes.Add("onclick",&lt;br /&gt;ClientScript.GetPostBackEventReference(MyGridView, "Select$" +&lt;br /&gt;e.Row.RowIndex.ToString()));&lt;br /&gt;e.Row.Style.Add("cursor", "pointer");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void MyGridView_SelectedIndexChanged(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;string strSelectedID = MyGridView.SelectedValue.ToString();&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2656758892102082638?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2656758892102082638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-select-row-in-gridview-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2656758892102082638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2656758892102082638'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-select-row-in-gridview-without.html' title='How to Select a Row in GridView without using select button'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-1054629418317272175</id><published>2008-06-18T01:16:00.000-07:00</published><updated>2008-11-05T19:57:39.616-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Login'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>How to Authenticate User using a customed Database</title><content type='html'>&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;If you want to authenticate a user against your own custom database then you can use the Authenticate event of the Login control. Here is a small example that shows how to achieve it. &lt;/span&gt;&lt;/p&gt;&lt;table id="AutoNumber2" style="BORDER-COLLAPSE: collapse;color:#111111;" cellspacing="0" cellpadding="0" width="100%" border="2" &gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="100%"&gt;&lt;span style="font-family:Arial;font-size:85%;color:#008000;"&gt;// Use Authenticate event if you want to do custom authentication &lt;/span&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;protected&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;void&lt;/span&gt;&lt;span style="font-size:85%;"&gt; Login1_Authenticate(&lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;object&lt;/span&gt;&lt;span style="font-size:85%;"&gt; sender, &lt;/span&gt;&lt;span style="font-size:85%;color:#008080;"&gt;AuthenticateEventArgs&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; e)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; userName = Login1.UserName;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; password = Login1.Password;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;bool&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; result = UserLogin(userName, password);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;if&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt; (result)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;e.Authenticated = &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;true&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;e.Authenticated = &lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;color:#0000ff;"&gt;false&lt;/span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;private&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;bool&lt;/span&gt;&lt;span style="font-size:85%;"&gt; UserLogin(&lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt; userName, &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt; password)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt; query = &lt;/span&gt;&lt;span style="font-size:85%;color:#800000;"&gt;@"SELECT UserName FROM Users WHERE &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#800000;"&gt;UserName = @UserName AND Password = @Password"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt; connectionString = (&lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt;)&lt;/span&gt;&lt;span style="font-size:85%;color:#008080;"&gt;ConfigurationManager&lt;/span&gt;&lt;span style="font-size:85%;"&gt;.ConnectionStrings[&lt;/span&gt;&lt;span style="font-size:85%;color:#800000;"&gt;"ConnectionString"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;].ConnectionString;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#008080;"&gt;SqlConnection&lt;/span&gt;&lt;span style="font-size:85%;"&gt; myConnection = &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;new&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#008080;"&gt;SqlConnection&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(connectionString);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#008080;"&gt;SqlCommand&lt;/span&gt;&lt;span style="font-size:85%;"&gt; myCommand = &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;new&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#008080;"&gt;SqlCommand&lt;/span&gt;&lt;span style="font-size:85%;"&gt;(query, myConnection);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;myCommand.Parameters.AddWithValue(&lt;/span&gt;&lt;span style="font-size:85%;color:#800000;"&gt;"@UserName"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;, userName);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;myCommand.Parameters.AddWithValue(&lt;/span&gt;&lt;span style="font-size:85%;color:#800000;"&gt;"@Password"&lt;/span&gt;&lt;span style="font-size:85%;"&gt;, password);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;myConnection.Open();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt; userId = (&lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;string&lt;/span&gt;&lt;span style="font-size:85%;"&gt;) myCommand.ExecuteScalar();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;myConnection.Close();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;if&lt;/span&gt;&lt;span style="font-size:85%;"&gt; (userId != &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;null&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &amp;amp;&amp;amp; userId.Length &gt; 0)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;return&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;true&lt;/span&gt;&lt;span style="font-size:85%;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;else&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;return&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;false&lt;/span&gt;&lt;span style="font-size:85%;"&gt;; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size:85%;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;As you can see that I am simply sending the values from the Login control to UserLogin method and returns &lt;i&gt;true&lt;/i&gt; or &lt;i&gt;false&lt;/i&gt; based on the authentication status. &lt;/span&gt;&lt;/p&gt;&lt;table id="AutoNumber3" style="BORDER-COLLAPSE: collapse;color:#111111;" cellspacing="0" cellpadding="0" width="100%" border="2" &gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="100%"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;When using custom authentication always remember to set the Authenticated property of the Login control to true or false based on the result of authentication. Also when authenticating a user against a custom database you don't need to provide the membership settings in the web.config file.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-1054629418317272175?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/1054629418317272175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-authenticate-user-using-customed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1054629418317272175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/1054629418317272175'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-authenticate-user-using-customed.html' title='How to Authenticate User using a customed Database'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-2111867326694314888</id><published>2008-06-18T00:03:00.000-07:00</published><updated>2008-11-05T19:58:14.809-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='GridView'/><title type='text'>How to use CheckBox in GridView.</title><content type='html'>&lt;h2&gt;Introduction&lt;/h2&gt;&lt;p&gt;In the preceding tutorial we examined how to add a column of radio buttons to the GridView for the purpose of selecting a particular record. A column of radio buttons is a suitable user interface when the user is limited to choosing at most one item from the grid. At times, however, we may want to allow the user to pick an arbitrary number of items from the grid. Web-based email clients, for example, typically display the list of messages with a column of checkboxes. The user can select an arbitrary number of messages and then perform some action, such as moving the emails to another folder or deleting them.&lt;/p&gt;&lt;p&gt;In this tutorial we will see how to add a column of checkboxes and how to determine what checkboxes were checked on postback. In particular, we’ll build an example that closely mimics the web-based email client user interface. Our example will include a paged GridView listing the products in the &lt;code&gt;Products&lt;/code&gt; database table with a checkbox in each row (see Figure 1). A “Delete Selected Products” button, when clicked, will delete those products selected.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig01VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 480px" alt="Each Product Row Includes a Checkbox" src="http://static.asp.net/asp.net/images/dataaccess3/52fig01VBs.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 1&lt;/strong&gt;: Each Product Row Includes a Checkbox &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig01VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Step 1: Adding a Paged GridView that Lists Product Information&lt;/h2&gt;&lt;p&gt;Before we worry about adding a column of checkboxes, let’s first focus on listing the products in a GridView that supports paging. Start by opening the &lt;code&gt;CheckBoxField.aspx&lt;/code&gt; page in the &lt;code&gt;EnhancedGridView&lt;/code&gt; folder and drag a GridView from the Toolbox onto the Designer, setting its &lt;code&gt;ID&lt;/code&gt; to &lt;code&gt;Products&lt;/code&gt;. Next, choose to bind the GridView to a new ObjectDataSource named &lt;code&gt;ProductsDataSource&lt;/code&gt;. Configure the ObjectDataSource to use the &lt;code&gt;ProductsBLL&lt;/code&gt; class, calling the &lt;code&gt;GetProducts()&lt;/code&gt; method to return the data. Since this GridView will be read-only, set the drop-down lists in the UPDATE, INSERT, and DELETE tabs to “(None)”.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig02VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 427px" alt="Create a New ObjectDataSource Named ProductsDataSource" src="http://static.asp.net/asp.net/images/dataaccess3/52fig02VB.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 2&lt;/strong&gt;: Create a New ObjectDataSource Named &lt;code&gt;ProductsDataSource&lt;/code&gt; &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig02VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig03VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 427px" alt="Configure the ObjectDataSource to Retrieve Data Using the GetProducts() Method" src="http://static.asp.net/asp.net/images/dataaccess3/52fig03VB.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 3&lt;/strong&gt;: Configure the ObjectDataSource to Retrieve Data Using the &lt;code&gt;GetProducts()&lt;/code&gt; Method &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig03VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig04VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 427px" alt="Set the Drop-Down Lists in the UPDATE, INSERT, and DELETE Tabs to “(None)”" src="http://static.asp.net/asp.net/images/dataaccess3/52fig04VB.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 4&lt;/strong&gt;: Set the Drop-Down Lists in the UPDATE, INSERT, and DELETE Tabs to “(None)” &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig04VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;After completing the Configure Data Source wizard, Visual Studio will automatically create BoundColumns and a CheckBoxColumn for the product-related data fields. Like we did in the previous tutorial, remove all but the &lt;code&gt;ProductName&lt;/code&gt;, &lt;code&gt;CategoryName&lt;/code&gt;, and &lt;code&gt;UnitPrice&lt;/code&gt; BoundFields, and change the &lt;code&gt;HeaderText&lt;/code&gt; properties to “Product”, “Category”, and “Price”. Configure the &lt;code&gt;UnitPrice&lt;/code&gt; BoundField so that its value is formatted as a currency. Also configure the GridView to support paging by checking the “Enable Paging” checkbox from the smart tag.&lt;/p&gt;&lt;p&gt;Let’s also add the user interface for deleting the selected products. Add a Button Web control beneath the GridView, setting its &lt;code&gt;ID&lt;/code&gt; to &lt;code&gt;DeleteSelectedProducts&lt;/code&gt; and its &lt;code&gt;Text&lt;/code&gt; property to “Delete Selected Products”. Rather than actually deleting products from the database, for this example we’ll just display a message stating the products that would have been deleted. To accommodate this, add a Label Web control beneath the Button. Set its ID to &lt;code&gt;DeleteResults&lt;/code&gt;, clear out its &lt;code&gt;Text&lt;/code&gt; property, and set its &lt;code&gt;Visible&lt;/code&gt; and &lt;code&gt;EnableViewState&lt;/code&gt; properties to &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;&lt;code class="code_block" id="code1"&gt;g="{0:c}" HeaderText="Price" HtmlEncode="False" SortExpression="UnitP&lt;/code&gt; &lt;code class="code_block" id="code1"&gt;&lt;/code&gt;&lt;code class="code_block" id="code1"&gt;&lt;/code&gt;&lt;span style="font-family:monospace;"&gt;&lt;br /&gt;&lt;br /&gt;T&lt;/span&gt;ake a moment to view the page in a browser (see Figure 5). At this point you should see the name, category, and price of the first ten products. &lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig05VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 481px" alt="The Name, Category, and Price of the First Ten Products are Listed" src="http://static.asp.net/asp.net/images/dataaccess3/52fig05VB.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 5&lt;/strong&gt;: The Name, Category, and Price of the First Ten Products are Listed &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig05VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Step 2: Adding a Column of Checkboxes&lt;/h2&gt;&lt;p&gt;Since ASP.NET 2.0 includes a CheckBoxField, one might think that it could be used to add a column of checkboxes to a GridView. Unfortunately, that is not the case, as the CheckBoxField is designed to work with a Boolean data field. That is, in order to use the CheckBoxField we must specify the underlying data field whose value is consulted to determine whether the rendered checkbox is checked. We cannot use the CheckBoxField to just include a column of unchecked checkboxes.&lt;/p&gt;&lt;p&gt;Instead, we must add a TemplateField and add a CheckBox Web control to its &lt;code&gt;ItemTemplate&lt;/code&gt;. Go ahead and add a TemplateField to the &lt;code&gt;Products&lt;/code&gt; GridView and make it the first (far-left) field. From the GridView’s smart tag, click on the “Edit Templates” link and then drag a CheckBox Web control from the Toolbox into the &lt;code&gt;ItemTemplate&lt;/code&gt;. Set this CheckBox’s &lt;code&gt;ID&lt;/code&gt; property to &lt;code&gt;ProductSelector&lt;/code&gt;.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig06VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 431px" alt="Add a CheckBox Web Control Named ProductSelector to the TemplateField’s ItemTemplate" src="http://static.asp.net/asp.net/images/dataaccess3/52fig06VBs.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 6&lt;/strong&gt;: Add a CheckBox Web Control Named &lt;code&gt;ProductSelector&lt;/code&gt; to the TemplateField’s &lt;code&gt;ItemTemplate&lt;/code&gt; &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig06VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;With the TemplateField and CheckBox Web control added, each row now includes a checkbox. Figure 7 shows this page, when viewed through a browser, after the TemplateField and CheckBox have been added.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig07VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 480px" alt="Each Product Row Now Includes a Checkbox" src="http://static.asp.net/asp.net/images/dataaccess3/52fig07VBs.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 7&lt;/strong&gt;: Each Product Row Now Includes a Checkbox &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig07VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Step 3: Determining What Checkboxes Were Checked On Postback&lt;/h2&gt;&lt;p&gt;At this point we have a column of checkboxes but no way to determine what checkboxes were checked on postback. When the “Delete Selected Products” button is clicked, though, we need to know what checkboxes were checked in order to delete those products.&lt;/p&gt;&lt;p&gt;The GridView’s &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rows.aspx"&gt;&lt;code&gt;Rows&lt;/code&gt; property&lt;/a&gt; provides access to the data rows in the GridView. We can iterate through these rows, programmatically access the CheckBox control, and then consult its &lt;code&gt;Checked&lt;/code&gt; property to determine whether the CheckBox has been selected.&lt;/p&gt;&lt;p&gt;Create an event handler for the &lt;code&gt;DeleteSelectedProducts&lt;/code&gt; Button Web control’s &lt;code&gt;Click&lt;/code&gt; event and add the following code:&lt;/p&gt;&lt;code class="code_block" id="code2"&gt;Protected Sub DeleteSelectedProducts_Click(sender As Object, e As EventArgs) _ Handles DeleteSelectedProducts.Click&lt;br /&gt;&lt;br /&gt;Dim atLeastOneRowDeleted As Boolean = False&lt;br /&gt;' Iterate through the Products.Rows property For Each row As GridViewRow In Products.Rows&lt;br /&gt;' Access the CheckBox Dim cb As CheckBox = row.FindControl("ProductSelector")&lt;br /&gt;If cb IsNot Nothing AndAlso cb.Checked Then&lt;br /&gt;' Delete row! (Well, not really...)&lt;br /&gt;atLeastOneRowDeleted = True&lt;br /&gt;' First, get the ProductID for the selected row&lt;br /&gt;Dim productID As Integer = _ Convert.ToInt32(Products.DataKeys(row.RowIndex).Value)&lt;br /&gt;' "Delete" the row DeleteResults.Text &amp;amp;= String.Format( _ "This would have deleted ProductID {0}&lt;br /&gt;", productID) &lt;/code&gt;&lt;p&gt;The &lt;code&gt;Rows&lt;/code&gt; property returns a collection of &lt;code&gt;GridViewRow&lt;/code&gt; instances that makeup the GridView’s data rows. The &lt;code&gt;For Each&lt;/code&gt; loop here enumerates this collection. For each &lt;code&gt;GridViewRow&lt;/code&gt; object, the row’s CheckBox is programmatically accessed using &lt;code&gt;row.FindControl("&lt;i&gt;controlID&lt;/i&gt;")&lt;/code&gt;. If the CheckBox is checked, the row’s corresponding &lt;code&gt;ProductID&lt;/code&gt; value is retrieved from the &lt;code&gt;DataKeys&lt;/code&gt; collection. In this exercise, we simply display an informative message in the &lt;code&gt;DeleteResults&lt;/code&gt; Label, although in a working application we’d instead make a call to the &lt;code&gt;ProductsBLL&lt;/code&gt; class’s &lt;code&gt;DeleteProduct(&lt;i&gt;productID&lt;/i&gt;)&lt;/code&gt; method.&lt;/p&gt;&lt;p&gt;With the addition of this event handler, clicking the “Delete Selected Products” button now displays the &lt;code&gt;ProductID&lt;/code&gt;s of the selected products.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig08VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 542px" alt="When the “Delete Selected Products” Button is Clicked the Selected Products’ ProductIDs are Listed" src="http://static.asp.net/asp.net/images/dataaccess3/52fig08VBs.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 8&lt;/strong&gt;: When the “Delete Selected Products” Button is Clicked the Selected Products’ &lt;code&gt;ProductID&lt;/code&gt;s are Listed &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig08VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Step 4: Adding “Check All” and “Uncheck All” Buttons&lt;/h2&gt;&lt;p&gt;If a user wants to delete all products on the current page, they must check each of the ten checkboxes. We can help expedite this process by adding a “Check All” button that, when clicked, selects all of the checkboxes in the grid. An “Uncheck All” button would be equally helpful.&lt;/p&gt;&lt;p&gt;Add two Button Web controls to the page, placing them above the GridView. Set the first one’s &lt;code&gt;ID&lt;/code&gt; to &lt;code&gt;CheckAll&lt;/code&gt; and its &lt;code&gt;Text&lt;/code&gt; property to “Check All”; set the second one’s &lt;code&gt;ID&lt;/code&gt; to &lt;code&gt;UncheckAll&lt;/code&gt; and its &lt;code&gt;Text&lt;/code&gt; property to “Uncheck All”.&lt;/p&gt;&lt;code class="code_block" id="code3"&gt;&lt;?xml:namespace prefix = asp /&gt;&lt;asp:button id="CheckAll" runat="server" text="Check All"&gt;&lt;asp:button id="UncheckAll" runat="server" text="Uncheck All"&gt;&lt;/code&gt;&lt;p&gt;Next, create a method in the code-behind class named &lt;code&gt;ToggleCheckState(&lt;i&gt;checkState&lt;/i&gt;)&lt;/code&gt; that, when invoked, enumerates the &lt;code&gt;Products&lt;/code&gt; GridView’s &lt;code&gt;Rows&lt;/code&gt; collection and sets each CheckBox’s &lt;code&gt;Checked&lt;/code&gt; property to the value of the passed in &lt;i&gt;checkState&lt;/i&gt; parameter.&lt;/p&gt;&lt;code class="code_block" id="code4"&gt;Private Sub ToggleCheckState(ByVal checkState As Boolean) ' Iterate through the Products.Rows property For Each row As GridViewRow In Products.Rows ' Access the CheckBox Dim cb As CheckBox = row.FindControl("ProductSelector") If cb IsNot Nothing Then cb.Checked = checkState End If Next End Sub&lt;/code&gt; &lt;p&gt;Next, create &lt;code&gt;Click&lt;/code&gt; event handlers for the &lt;code&gt;CheckAll&lt;/code&gt; and &lt;code&gt;UncheckAll&lt;/code&gt; buttons. In &lt;code&gt;CheckAll&lt;/code&gt;’s event handler, simply call &lt;code&gt;ToggleCheckState(True)&lt;/code&gt;; in &lt;code&gt;UncheckAll&lt;/code&gt;, call &lt;code&gt;ToggleCheckState(False)&lt;/code&gt;.&lt;/p&gt;&lt;code class="code_block" id="code5"&gt;Protected Sub CheckAll_Click(sender As Object, e As EventArgs) _ Handles CheckAll.Click ToggleCheckState(True) End Sub Protected Sub UncheckAll_Click(sender As Object, e As EventArgs) _ Handles UncheckAll.Click ToggleCheckState(False) End Sub&lt;/code&gt; &lt;p&gt;With this code, clicking the “Check All” button causes a postback and checks all of the checkboxes in the GridView. Likewise, clicking “Uncheck All” unselects all checkboxes. Figure 9 shows the screen after the “Check All” button has been checked.&lt;/p&gt;&lt;div class="photo_container"&gt;&lt;div class="photo_container_inner"&gt;&lt;div class="photo_border"&gt;&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig09VB.png"&gt;&lt;img style="WIDTH: 550px; HEIGHT: 503px" alt="Clicking the “Check All” Button Selects All Checkboxes" src="http://static.asp.net/asp.net/images/dataaccess3/52fig09VBs.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p class="caption"&gt;&lt;strong&gt;Figure 9&lt;/strong&gt;: Clicking the “Check All” Button Selects All Checkboxes &lt;span class="nobreak"&gt;(&lt;a href="http://static.asp.net/asp.net/images/dataaccess3/52fig09VB.png"&gt;Click to view full-size image&lt;/a&gt;)&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class="blockquote"&gt;&lt;b&gt;Note:&lt;/b&gt; When displaying a column of checkboxes, one approach for selecting or unselecting all of the checkboxes is through a checkbox in the header row. Moreover, the current “Check All” / “Uncheck All” implementation requires a postback. The checkboxes can be checked or unchecked, however, entirely through client-side script, thereby providing a snappier user experience. To explore using a header row checkbox for “Check All” and “Uncheck All” in detail, along with a discussion on using client-side techniques, check out &lt;a href="http://aspnet.4guysfromrolla.com/articles/053106-1.aspx"&gt;Checking All CheckBoxes in a GridView Using Client-Side Script and a Check All CheckBox&lt;/a&gt;.&lt;/p&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;p&gt;In cases where you need to let users choose an arbitrary number of rows from a GridView before proceeding, adding a column of checkboxes is one option. As we saw in this tutorial, including a column of checkboxes in the GridView entails adding a TemplateField with a CheckBox Web control. By using a Web control (versus injecting markup directly into the template, as we did in the previous tutorial) ASP.NET automatically remembers what CheckBoxes were and were not checked across postback. We can also programmatically access the CheckBoxes in code to determine whether a given CheckBox is checked, or to chnage the checked state.&lt;/p&gt;&lt;p&gt;This tutorial and the last one looked at adding a row selector column to the GridView. In our next tutorial we’ll examine how, with a bit of work, we can add inserting capabilities to the GridView.&lt;/p&gt;&lt;br /&gt;&lt;/asp:button&gt;&lt;/asp:button&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-2111867326694314888?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/2111867326694314888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-use-checkbox-in-gridview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2111867326694314888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/2111867326694314888'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-to-use-checkbox-in-gridview.html' title='How to use CheckBox in GridView.'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-4163800239314311598</id><published>2008-06-11T01:43:00.000-07:00</published><updated>2008-11-05T19:58:34.678-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>Method Error 500</title><content type='html'>I've been assigned a bug concerning an AJAX cascading drop down combo box. When the Ajax cascading drop down combo box's value is changed by the user, a secondary combo box has its values reloaded. This is done by calling a web service. The bug is that "Method Error 500" is displayed as the only item on occasion.&lt;br /&gt;&lt;br /&gt;After some rooting around, it turns out that this is caused by too much data being returned in the SQL query behind the web service call, so the web service returns an error. A simple change to the web.config file can increase the size limit of data returned:&lt;br /&gt;&lt;br /&gt;&amp;lt;system.web.extensions&amp;gt;&lt;br /&gt;&amp;lt;scripting&amp;gt;&lt;br /&gt;&amp;lt;webservices&amp;gt;&lt;br /&gt;&amp;lt;jsonserialization maxjsonlength="5000000"&amp;gt;&lt;br /&gt;&amp;lt;/jsonserialization&amp;gt;&lt;br /&gt;&amp;lt;/webservices&amp;gt;&lt;br /&gt;&amp;lt;/scripting&amp;gt;&lt;br /&gt;&amp;lt;system.web.extensions&amp;gt;&lt;br /&gt;&amp;lt;scripting&amp;gt;&lt;br /&gt;&amp;lt;webservices&amp;gt;&lt;br /&gt;&amp;lt;jsonserialization maxjsonlength="5000000"&amp;gt;&lt;br /&gt;&amp;lt;/jsonserialization&amp;gt;&lt;br /&gt;&amp;lt;/webservices&amp;gt;&lt;br /&gt;&amp;lt;/scripting&amp;gt;&lt;br /&gt;&amp;lt;/system.web.extensions&amp;gt;&amp;lt;/system.web.extensions&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-4163800239314311598?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/4163800239314311598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/method-error-500.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4163800239314311598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4163800239314311598'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/method-error-500.html' title='Method Error 500'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-4030125196614460328</id><published>2008-06-08T20:39:00.000-07:00</published><updated>2008-11-05T19:59:02.784-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS Outlook'/><category scheme='http://www.blogger.com/atom/ns#' term='Autoresponder'/><title type='text'>How Do I Make an Out of Office AutoResponder If I Use Outlook Without Exchange Server?</title><content type='html'>&lt;table id="table8" style="BORDER-COLLAPSE: collapse" cellpadding="0" width="100%" border="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;This is a question I get asked a lot. If you have Outlook at work Exchange Server), you are used to the Out of Office Assistant which is easy to use to set up a reply to all of your mail when you are away from the office. But, without Exchange Server, this option is not available to you in your Tools menu, so you have to create a rule that will reply to all using a template.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;b&gt;NOTE:&lt;/b&gt; In order for this to work correctly, &lt;b&gt;DO NOT use Word as your email editor&lt;/b&gt; and &lt;b&gt;use PLAIN TEXT as your mail format.&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;b&gt;First: How To Make the Template&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Open a new blank email and write your message with any info you want included. For example:&lt;br /&gt;&lt;br /&gt;Hi. I'm out of town for three days. If you want to reach me, you can email me at joeblow@duhhh.com. Otherwise, I will reply to you when I return on Dec. 15, 2002.&lt;br /&gt;&lt;br /&gt;Sincerely,&lt;br /&gt;Eugene&lt;br /&gt;&lt;br /&gt;Once you are done setting up the message, click on the File menu within the email and choose "Save As". When the Save As box comes up, use the menu at the bottom that says "Save as type" and choose Outlook Template (*.oft).&lt;br /&gt;&lt;br /&gt;Notice when you choose to save it as a template, at the top of the Save As box, where it says "Save In", it now shows that it is saving it in your Templates folder. DO NOT CHANGE THIS LOCATION. It needs to be there so you can select it from your Templates library.&lt;br /&gt;&lt;br /&gt;Give the template a name and click the Save button. Now you can just close this mail by clicking on the X in its upper right corner. (Say No when Outlook asks if you want to save the mail. Since we have already saved the Template, there is no need to save the actual email.)&lt;/span&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:Arial;"&gt;&lt;b&gt;Second: How To Make the Rule So It AutoReplies To Everyone&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Go to your Tools menu in Outlook and select Rules Wizard. Click on "New" to start the Wizard. In the first step where it asks what conditions you want to set for this rule, just leave everything unchecked and click on Next and Outlook will give you a message that tells you this rule will be applied to all mail you receive. Click Yes. The first step of the Rules Wizard asks if you want to base this rule on an existing rule or start with a new rule. Tell it to start with a new blank rule.)&lt;br /&gt;&lt;br /&gt;The next step asks what you want to do with the mail. Look through the list of choices and check the one that says "Reply with a specific template". Now you will see the words "a specific template" in the bottom pane. Click on the underlined words and use the dropdown box at the top of the box you now see to select "User Templates in File System" and you will see your template. Select it and click on Open. Now you will see that your rule is setup to reply to everyone with this template.&lt;br /&gt;&lt;br /&gt;If you want to setup any exceptions for this rule, you can click Next. Otherwise, just click on Finish and your rule is made and turned on.&lt;br /&gt;&lt;br /&gt;Now, if you don't want the rule to run now, but instead, want it to start running tomorrow or some other time, just go back to Tools&gt;Rules Wizard and find your rule and uncheck the box beside it. Then, you can just return here before you go away to turn the rule on by checking it again. When you return home, remember to go back here and uncheck it again to turn it off, or click on it to select it and click on the button that says Delete to remove it completely.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-4030125196614460328?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/4030125196614460328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-do-i-make-out-of-office.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4030125196614460328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/4030125196614460328'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/how-do-i-make-out-of-office.html' title='How Do I Make an Out of Office AutoResponder If I Use Outlook Without Exchange Server?'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-3153057938825546405</id><published>2008-06-05T01:14:00.000-07:00</published><updated>2008-11-12T19:59:20.361-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft Heroes Happen here event</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_GQ1PR-zsx8c/SEeiDoK2XdI/AAAAAAAAAb0/grnk2WQBrqQ/s1600-h/Heros+happen+here.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208309677283499474" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 603px; CURSOR: pointer; HEIGHT: 203px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_GQ1PR-zsx8c/SEeiDoK2XdI/AAAAAAAAAb0/grnk2WQBrqQ/s400/Heros+happen+here.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Microsoft has launch the new windows server 2008, Visual Studio 2008 and SQL server 2008. And as a developer, I am impacted by the changes in these technologies.&lt;br /&gt;&lt;br /&gt;Unfortunately, Microsoft learning is way behind in the times, and the new string of certifications does not come out until August 2008. This means that I need to learn everything quickly on my own again. time to sign up with either Comat or New Horizons to upgrade my skills and certifications. The CITREP offered by IDA offers a 50% subsidy for courses capped at $3000 making upgrading my certifications very attractive.&lt;br /&gt;&lt;br /&gt;New Horizons seems to get my vote, as they offer PMP, Oracle, Lotus, Security and JAVA as well in addition to .NET.&lt;br /&gt;&lt;br /&gt;Comat is a close competitor, with PMP and N+ and .NET.&lt;br /&gt;&lt;br /&gt;The problem is these courses are crazy and insanely expensive. :P This is the only thing stopping me from training and upgrading my certifications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-3153057938825546405?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/3153057938825546405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/06/microsoft-heroes-happen-here-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3153057938825546405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/3153057938825546405'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/06/microsoft-heroes-happen-here-event.html' title='Microsoft Heroes Happen here event'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_GQ1PR-zsx8c/SEeiDoK2XdI/AAAAAAAAAb0/grnk2WQBrqQ/s72-c/Heros+happen+here.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-6197763142521319023</id><published>2008-02-21T01:53:00.000-08:00</published><updated>2008-11-05T20:00:30.557-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>Awesome AJAX controls for .NET</title><content type='html'>&lt;a href="http://ajax.asp.net/ajaxtoolkit/"&gt;http://ajax.asp.net/ajaxtoolkit/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.componentart.com/"&gt;http://www.componentArt.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-6197763142521319023?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/6197763142521319023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2008/02/awesome-ajax-controls-for-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/6197763142521319023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/6197763142521319023'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2008/02/awesome-ajax-controls-for-net.html' title='Awesome AJAX controls for .NET'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-134367909080364542</id><published>2007-02-08T00:18:00.000-08:00</published><updated>2008-11-05T20:28:05.510-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Error'/><title type='text'>The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID</title><content type='html'>You may see this error - more than once - when working with your Microsoft Office SharePoint Server (MOSS) 2007 deployment. This animal / error generally shows itself after you have applied an upgrade to an existing deployment. For example, when upgrading from B2 MOSS to B2TR MOSS - or when applying a special service pack from MSFT - you may begin to see a lot of these errors pop up in the SYSTEM event log.&lt;br /&gt;&lt;br /&gt;The error CLSID is followed by a class ID for the DCOM+ application that the service account trying to activate that application - does NOT have permission to activate.&lt;br /&gt;&lt;br /&gt;For example, let's say I installed MOSS on a server, and used the account mossService as the service account (a least privileged, user account you created to run the MOSS service(s))., when I get this error, I could very well see an error like the following:&lt;br /&gt;&lt;br /&gt;The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID&lt;br /&gt;{61738644-F196-11D0-9953-00C04FD919C1}&lt;br /&gt;to the user &lt;servername&gt;\mossService SID (S-1-5-21-&lt;servicesid&gt;). This security permission can be modified using the Component Services administrative tool.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Copy the GUID following the CLSID above, and Start--&gt;Run--&gt;regedit&lt;/li&gt;&lt;li&gt;With the registry editor open, ensure that your cursor is on the computer at the beginning of the tree (make sure you are not in the middle of some previous edit session in the registry editor).&lt;/li&gt;&lt;li&gt;Edit--&gt;Find and paste in the GUID. It'll stop at the application entry - and you will want to note the application name on the right side pane. In this example, it was the IIS WAMREG admin service that popped up.&lt;/li&gt;&lt;li&gt;Now, open Component Services (typically, from the server - Start--&gt;Administrative Tools--&gt;Component Services), expand Component Services, Computers, My Computer, DCOM Config. Scroll down and find the application (IIS WAMREG in this case). &lt;/li&gt;&lt;li&gt;Right-Click--&gt;Properties and select the Security tab. You'll have some options here - the first block Launch and Activation Permissions - ensure that the Customize radio button is selected, and click Edit. Now, add your service account - giving it launch and activate - and in some requirements - remote launch / activate permission.&lt;/li&gt;&lt;li&gt;Restart IIS and continue on. &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-134367909080364542?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/134367909080364542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2007/02/application-specific-permission.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/134367909080364542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/134367909080364542'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2007/02/application-specific-permission.html' title='The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-7220038521106170374</id><published>2006-12-06T00:50:00.000-08:00</published><updated>2006-12-06T00:51:57.974-08:00</updated><title type='text'>Jython Quick References</title><content type='html'>&lt;p&gt;&lt;a name="table1"&gt;&lt;span class="smalltitle"&gt;Table 1. Summary of Jython data types&lt;/span&gt;&lt;/a&gt;&lt;/p&gt; &lt;table border="1" cellpadding="3" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;b&gt;Type&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Comment&lt;/b&gt;  &lt;/td&gt;&lt;td&gt;&lt;b&gt;Example&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;Null&lt;/td&gt;&lt;td&gt;An undefined value (like &lt;code&gt;null&lt;/code&gt; in the Java language).&lt;/td&gt;&lt;td&gt;&lt;code&gt;None&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;Integer&lt;/td&gt;&lt;td&gt;A normal (&lt;code&gt;int&lt;/code&gt; in the Java language) or long (&lt;code&gt;BigInteger&lt;/code&gt; in the Java language) integer number.&lt;/td&gt;&lt;td&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;-1  0  100&lt;br /&gt;-1L  1000000000000000000000000000000000000000000001L&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt;Float &lt;/td&gt;&lt;td&gt;A fractional or exponential (like &lt;code&gt;double&lt;/code&gt; in the Java language) number.&lt;/td&gt;&lt;td&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;1.0&lt;br /&gt;-1e6  0.000001e-10  1E11&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Complex            &lt;/td&gt;&lt;td&gt; A pair of floats supporting complex arithmetic.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;1j  -10J&lt;br /&gt;2-3j  1e6j&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; String             &lt;/td&gt;&lt;td&gt; An immutable sequence of characters. There is no character type (use one character strings instead).           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;"a string"&lt;br /&gt;'a string'&lt;br /&gt;"""a long (possibly multi-line) string"""&lt;br /&gt;'''another (possibly multi-line) long string'''&lt;br /&gt;r'''^xxx(.*?)\.yyy(.*?)\.zzz(.*?)\.$'''&lt;br /&gt;'x'  "y" '\n' "\\"&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;        &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Range              &lt;/td&gt;&lt;td&gt; An immutable sequence of integers.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;range(10)&lt;br /&gt;range(10,0,-1)&lt;br /&gt;xrange(1,100000,10)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Tuple              &lt;/td&gt;&lt;td&gt; An immutable sequence of any type (like  &lt;code&gt;java.util.Collections.unmodifiableCollection(someList)&lt;/code&gt;).           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;()  (1,)  (1,2,3)&lt;br /&gt;(1, "mixed", 2, "tuple")&lt;br /&gt;((1,2),(3,4))&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;        &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; List               &lt;/td&gt;&lt;td&gt; A mutable sequence of any type (like  &lt;code&gt;java.util.ArrayList&lt;/code&gt;).           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;[]  [1]  [1,2,3]&lt;br /&gt;[1, 'mixed', 2, 'list']&lt;br /&gt;[[1,2],[3,4]]&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Map            &lt;/td&gt;&lt;td&gt; A mutable collection of items (name/value pairs) (like  &lt;code&gt;java.util.Map&lt;/code&gt;). Names must be immutable and unique;  values may be &lt;code&gt;None&lt;/code&gt;.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;{}&lt;br /&gt;{1:'one',2:'two',3:'three'}&lt;br /&gt;{"one";1, "two":2, "three":3}&lt;br /&gt;{"x":1, "ints":(1,2,3),&lt;br /&gt;"name":{"first":"Barry", last":"Feigenbaum"}}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Boolean            &lt;/td&gt;&lt;td&gt; A true/false value based on other types.               &lt;/td&gt;&lt;td&gt; &lt;b&gt;false&lt;/b&gt; - 0 or empty:  &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;None&lt;br /&gt;0  0.0&lt;br /&gt;()  []&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;true&lt;/b&gt; - non-0, not empty:  &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;1  -1  0.0001&lt;br /&gt;[1]  [1,2,3]  {"greeting":"Hello!"}&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Function               &lt;/td&gt;&lt;td&gt; Any function. Functions do not need to be members of classes.               &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;lambda x: x &gt; 0&lt;br /&gt;&lt;br /&gt;def isPositive(x): return x &gt; 0&lt;br /&gt;&lt;br /&gt;def addem(x,y,z):&lt;br /&gt;   return x + y + z&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;           &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Class              &lt;/td&gt;&lt;td&gt; Any class. Classes are namespaces for class attributes and functions (called methods).           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;class MyClass:&lt;br /&gt;   x = 1&lt;br /&gt;   y = 2&lt;br /&gt;&lt;br /&gt;class subclass(superClass):&lt;br /&gt;   def method1(self): ...&lt;br /&gt;&lt;br /&gt;   def method2(self, arg1, arg2): ...&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Module             &lt;/td&gt;&lt;td&gt; A source file (and namespace) that contains variable, function and/or class definitions.            &lt;/td&gt;&lt;td&gt; Any &lt;code&gt;.py&lt;/code&gt; file that defines importable variables, functions and/or classes. If it does not define any of these then it is just called a script. &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;br /&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" height="1" width="100%" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class="no-print" align="right" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr align="right"&gt;&lt;td&gt;&lt;table border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="middle"&gt;&lt;img src="http://www.ibm.com/i/v14/icons/u_bold.gif" alt="" border="0" height="16" width="16" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;td align="right" valign="top"&gt;&lt;a href="http://www-128.ibm.com/developerworks/java/library/j-alj07064/#main" class="fbox"&gt;&lt;b&gt;Back to top&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a name="types"&gt;&lt;span class="atitle"&gt;Statement types&lt;/span&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Jython provides the statement types summarized in Table 2.&lt;/p&gt;  &lt;p&gt;&lt;a name="table1"&gt;&lt;span class="smalltitle"&gt;Table 2. Summary of Jython statement types&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;       &lt;table border="1" cellpadding="3" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt; &lt;b&gt;Statement&lt;/b&gt;               &lt;/td&gt;&lt;td&gt; &lt;b&gt;Comment&lt;/b&gt;             &lt;/td&gt;&lt;td&gt; &lt;b&gt;Examples&lt;/b&gt;           &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Expression             &lt;/td&gt;&lt;td&gt; Any expression. The results are discarded. Often used for their side effects.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;(1 * 2) ** 3 / 4&lt;br /&gt;&lt;br /&gt;"string"[2:] == "ring"&lt;br /&gt;&lt;br /&gt;someFunction(1, 2, 3)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Assignment             &lt;/td&gt;&lt;td&gt; Assigns an expression to a target.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;x = 3&lt;br /&gt;x = f(1,32,3) * 10 + x&lt;br /&gt;&lt;br /&gt;list[1:3] = [7, 8, 9 , 10]&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Augmented Assignment               &lt;/td&gt;&lt;td&gt; Updates a target with an expression.            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;x *= 100&lt;br /&gt;&lt;br /&gt;s += "…"&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Unpacking Assignment               &lt;/td&gt;&lt;td&gt; Assigns elements of a sequence to multiple targets; very convenient for access to tuple and list members. Note that the expression &lt;code&gt;1,2,3&lt;/code&gt; is a short form of  &lt;code&gt;(1,2,3)&lt;/code&gt;.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;x,y,z = 1,2,3&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Multiple Assignment            &lt;/td&gt;&lt;td&gt; Assigns the same expression to multiple targets.            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;z = y = z = 10&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Pass               &lt;/td&gt;&lt;td&gt; No operation.               &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;pass&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; If&lt;br /&gt;If/Else&lt;br /&gt;If/Elif/Else               &lt;/td&gt;&lt;td&gt; Conditional processing.             &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;if x &lt; 0: x = -x&lt;br /&gt;&lt;br /&gt;if x == 3:&lt;br /&gt;   print "It's three!"&lt;br /&gt;&lt;br /&gt;if   x == 1: ...&lt;br /&gt;elif x == 2: ...&lt;br /&gt;elif x == 3: ...&lt;br /&gt;else: print "Bad value " + x&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; While              &lt;/td&gt;&lt;td&gt; Looping over a condition.               &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;x = 10&lt;br /&gt;while x &gt; 0:&lt;br /&gt;   print x   &lt;br /&gt;   x -= 1&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; For            &lt;/td&gt;&lt;td&gt; Iterates over a sequence. Use &lt;code&gt;range&lt;/code&gt; to iterate over a numeric sequence.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;for i in range(10): print i&lt;br /&gt;&lt;br /&gt;for c in "A string":&lt;br /&gt;   print c&lt;br /&gt;&lt;br /&gt;for i in (10, "Hello", 1e6):&lt;br /&gt;   print func(i)&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Continue               &lt;/td&gt;&lt;td&gt; Advances to the next loop (while/for) iteration.             &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;for i in range(10):&lt;br /&gt;   if not testOk(i):&lt;br /&gt;       continue&lt;br /&gt;   :&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Break              &lt;/td&gt;&lt;td&gt; Exits a loop (while/for)            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;for i in range(10):&lt;br /&gt;   if testBad(i):&lt;br /&gt;       break&lt;br /&gt;   :&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Delete             &lt;/td&gt;&lt;td&gt; Removes a variable or sequence element(s) or class attribute.            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;del x&lt;br /&gt;&lt;br /&gt;del list[3:5]&lt;br /&gt;&lt;br /&gt;del x.attr1&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Global             &lt;/td&gt;&lt;td&gt; Declares a reference to a global value; used in functions.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;x,y,z = 0,1,2&lt;br /&gt;def f(a,b,c):&lt;br /&gt;   global x,y,z&lt;br /&gt;   :&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Print              &lt;/td&gt;&lt;td&gt; Prints expression(s) to a stream.            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;print "Hello World!"&lt;br /&gt;print "Hello","World!"&lt;br /&gt;print "Hello" + ' ' + "World!"&lt;br /&gt;&lt;br /&gt;msg = "Name: %(last)s, (first)s"&lt;br /&gt;data = {'last':"Feigenbaum", 'first':"Barry"}&lt;br /&gt;print &gt;&gt;out, msg % data&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Assert             &lt;/td&gt;&lt;td&gt; Asserts a condition is true.             &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;def process(v):&lt;br /&gt;   assert v &gt; 0, "Illegal value %i" % v&lt;br /&gt;   :&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Import             &lt;/td&gt;&lt;td&gt; Imports all or part of a module.            &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;import sys&lt;br /&gt;from sys import argv&lt;br /&gt;from javax import swing&lt;br /&gt;from java.util import Map&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Execute            &lt;/td&gt;&lt;td&gt; Executes a string/file as a subprogram. There is also a related function, &lt;code&gt;exec&lt;/code&gt;, that executes a constructed string and returns its result.  This support allows you to dynamically create programs.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;globals = {'x':1, 'y':2, 'z':3}&lt;br /&gt;locals = {'list':(1,2,3)}&lt;br /&gt;code = "print x, y, z, list"&lt;br /&gt;exec code in globals, locals&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Try/Except             &lt;/td&gt;&lt;td&gt; Executes code within an exception handler.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;try:&lt;br /&gt;   x = int(string)&lt;br /&gt;except ValueError, e:&lt;br /&gt;   x = 0&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Try/Finally            &lt;/td&gt;&lt;td&gt; Executes code with a cleanup routine.               &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;f = open("test.dat")&lt;br /&gt;try:&lt;br /&gt;   lines = f.readlines()&lt;br /&gt;finally:&lt;br /&gt;   f.close()&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Raise              &lt;/td&gt;&lt;td&gt; Creates and throws an exception.             &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;def factorial(x):&lt;br /&gt;   raise ValueError, "x must be &gt; 0"&lt;br /&gt;   :&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Define             &lt;/td&gt;&lt;td&gt; Defines a function; arguments may be optional and/or keywords;  Functions are generic which allows for very flexible programming.           &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;def f(x,y=2,z=10): return x+y+z&lt;br /&gt;&lt;br /&gt;q = f(1,2) + f(3) + f(4,5,6)&lt;br /&gt;s = f("a","b","c")&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Return             &lt;/td&gt;&lt;td&gt; Returns from a function with an optional value.              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;return 10&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td&gt; Class              &lt;/td&gt;&lt;td&gt; Defines a class (a container for attributes and methods) .              &lt;/td&gt;&lt;td&gt; &lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="code-outline"&gt;&lt;pre class="displaycode"&gt;class X: pass&lt;br /&gt;&lt;br /&gt;class MyClass(SomeClass):  &lt;br /&gt;   pass&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;          &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;br /&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://www.ibm.com/i/v14/rules/blue_rule.gif" alt="" height="1" width="100%" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class="no-print" align="right" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr align="right"&gt;&lt;td&gt;&lt;table border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="middle"&gt;&lt;img src="http://www.ibm.com/i/v14/icons/u_bold.gif" alt="" border="0" height="16" width="16" /&gt;&lt;br /&gt;&lt;/td&gt;&lt;td align="right" valign="top"&gt;&lt;a href="http://www-128.ibm.com/developerworks/java/library/j-alj07064/#main" class="fbox"&gt;&lt;b&gt;Back to top&lt;/b&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-7220038521106170374?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/7220038521106170374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/12/jython-quick-references.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/7220038521106170374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/7220038521106170374'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/12/jython-quick-references.html' title='Jython Quick References'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-7926040683588275240</id><published>2006-11-28T18:03:00.000-08:00</published><updated>2006-11-28T18:11:12.885-08:00</updated><title type='text'>Reading and Editing Registry Keys</title><content type='html'>First, you need to import Microsoft.win32.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Sample code for  edit the registry&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="font-size:85%;"&gt;Public Shared Sub UpdateiPhysicalFlagTo0()&lt;br /&gt;        Dim regConnectionKey As RegistryKey&lt;br /&gt;        regConnectionKey = Registry.LocalMachine.OpenSubKey("key here", True)&lt;br /&gt;        If (regConnectionKey Is Nothing) Then&lt;br /&gt;            regConnectionKey.Close()&lt;br /&gt;        Else&lt;br /&gt;            Try&lt;br /&gt;                regConnectionKey.SetValue("FirstTimeTrain", "0")&lt;br /&gt;                regConnectionKey.Close()&lt;br /&gt;            Catch er As Exception&lt;br /&gt;                Throw New Exception(er.Message)&lt;br /&gt;            End Try&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;font-size:100%;" &gt;Sample code for reading registry&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Public Shared Function GetRegistryFirstTimeTraining() As Boolean&lt;br /&gt;        Dim bool As Boolean = False&lt;br /&gt;        Dim regConnectionKey As RegistryKey&lt;br /&gt;        regConnectionKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\SQLView\\DMSConnection")&lt;br /&gt;        If (regConnectionKey Is Nothing) Then&lt;br /&gt;            Throw New Exception("GetRegistryFirstTimeTraining() : The registry key is not found")&lt;br /&gt;        Else&lt;br /&gt;            Try&lt;br /&gt;                Dim vr As String&lt;br /&gt;                vr = regConnectionKey.GetValue("FirstTimeTrain")&lt;br /&gt;                regConnectionKey.Close()&lt;br /&gt;                If (vr.ToString() = "1") Then&lt;br /&gt;                    bool = True&lt;br /&gt;                End If&lt;br /&gt;                Return bool&lt;br /&gt;            Catch er As Exception&lt;br /&gt;                Throw New Exception(er.Message)&lt;br /&gt;            End Try&lt;br /&gt;        End If&lt;br /&gt;    End Function&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-7926040683588275240?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/7926040683588275240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/11/reading-and-editing-registry-keys.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/7926040683588275240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/7926040683588275240'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/11/reading-and-editing-registry-keys.html' title='Reading and Editing Registry Keys'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-116427523328540877</id><published>2006-11-23T01:40:00.000-08:00</published><updated>2006-11-23T01:47:13.296-08:00</updated><title type='text'>IDIOTIC Me Missing Dlls</title><content type='html'>When an application I was developing failed to work in the deployment area, I struggled hard to find the bug, and the clause of the problem.&lt;br /&gt;&lt;br /&gt;Like most novice programmers, I concentrated on the code, twinking here and there, trying to get it working. But tried as I might, I could not find the clause of the problem. Finally I could not bear it any longer, approached my supervisor for help to trace the problem.&lt;br /&gt;&lt;br /&gt;My supervisor, Sindy, is a smart lady, who immediately look at the dll.. And discovered that one dll is missing from the deployment package. When she inserted the missing dll, the whole thing work well.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Lesson Learnt and Humble pie eaten:&lt;/span&gt; Always check the dll when you are deploying to a the deployment area to make sure no missing dll. This save you a lot of time in the long run. Missing dlls are very hard to trace and problematic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-116427523328540877?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/116427523328540877/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/11/idiotic-me-missing-dlls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116427523328540877'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116427523328540877'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/11/idiotic-me-missing-dlls.html' title='IDIOTIC Me Missing Dlls'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-116400292943418179</id><published>2006-11-19T22:06:00.000-08:00</published><updated>2006-11-19T22:08:49.453-08:00</updated><title type='text'>Oracle and Autonumber</title><content type='html'>&lt;table summary="layout table" border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;tr valign="top"&gt;  &lt;td&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td&gt;        &lt;div class="txt"&gt;       Oracle does not have an autonumber like SQLServer has. Oracle's way to for autonumbers is using        sequences and triggers.         The sequence makes sure that &lt;i&gt;unique&lt;/i&gt; numbers are generated while the trigger fills the these numbers into        the column for which an autonumber is desired. This is demonstrated in the following.     &lt;/div&gt;      &lt;div class="txt"&gt;       I need a table with a autonumber column. In this case, it will be column &lt;code&gt;id&lt;/code&gt;.     &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;create table tbl_autonumber(&lt;br /&gt;id     number        primary key,&lt;br /&gt;txt    varchar2(20)&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;       &lt;div class="txt"&gt;       Then, the sequence:     &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;&lt;a href="http://www.adp-gmbh.ch/ora/sql/create_sequence.html"&gt;create sequence&lt;/a&gt; seq_autonumber;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;       &lt;div class="txt"&gt;       And the trigger. It fires whenever a new record is inserted and assigns the sequence's next value (using nextval) to       :new.id.     &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;create trigger trg_autonumber&lt;br /&gt;before insert on tbl_autonumber&lt;br /&gt;for each row&lt;br /&gt;begin&lt;br /&gt;select seq_autonumber.&lt;b&gt;nextval&lt;/b&gt; into :new.id from &lt;a href="http://www.adp-gmbh.ch/ora/misc/dual.html"&gt;dual&lt;/a&gt;;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;       &lt;div class="txt"&gt;       Now, three records are inserted:     &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;insert into tbl_autonumber (txt) values('bar');&lt;br /&gt;insert into tbl_autonumber (txt) values('baz');&lt;br /&gt;insert into tbl_autonumber (txt) values('qqq');&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;   &lt;div&gt;&lt;pre class="code"&gt;select * from tbl_autonumber;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;       &lt;div class="txt"&gt;       The trigger did its job and filled &lt;code&gt;id&lt;/code&gt; with unique values:     &lt;/div&gt;  &lt;div&gt;&lt;pre class="out"&gt;        ID TXT&lt;br /&gt;       1 bar&lt;br /&gt;       2 baz&lt;br /&gt;       3 qqq&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;     &lt;div class="txt"&gt;   Now, trying to circumvent the 'autonumber' and specify an aribtrary &lt;i&gt;id&lt;/i&gt;:   &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;insert into tbl_autonumber (id, txt) values(100, '###');&lt;br /&gt;insert into tbl_autonumber (id, txt) values(200, '???');&lt;br /&gt;insert into tbl_autonumber (id, txt) values(300, '!!!');&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;      &lt;div class="txt"&gt;    Doesn't work, is overwritten by trigger!   &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;&lt;a href="http://www.adp-gmbh.ch/ora/sql/select.html"&gt;select&lt;/a&gt; * from tbl_autonumber;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;   &lt;div&gt;&lt;pre class="out"&gt;        ID TXT&lt;br /&gt;---------- -------------------------&lt;br /&gt;       1 bar&lt;br /&gt;       2 baz&lt;br /&gt;       3 qqq&lt;br /&gt;       4 ###&lt;br /&gt;       5 ???&lt;br /&gt;       6 !!!&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;div class="txt"&gt;     Changing the trigger and ...   &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;create or replace trigger trg_autonumber&lt;br /&gt;before insert on tbl_autonumber&lt;br /&gt;for each row&lt;br /&gt;begin&lt;br /&gt;if :new.id is null then&lt;br /&gt;  select seq_autonumber.nextval into :new.id from &lt;a href="http://www.adp-gmbh.ch/ora/misc/dual.html"&gt;dual&lt;/a&gt;;&lt;br /&gt;end if;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;      &lt;div class="txt"&gt; .... trying again to overrule the trigger:   &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;insert into tbl_autonumber (id, txt) values(111, 'This');&lt;br /&gt;insert into tbl_autonumber (id, txt) values(222, 'should');&lt;br /&gt;insert into tbl_autonumber (id, txt) values(333, 'work');&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;     &lt;div class="txt"&gt;     And indeed, it worked. However....   &lt;/div&gt;  &lt;div&gt;&lt;pre class="code"&gt;&lt;a href="http://www.adp-gmbh.ch/ora/sql/select.html"&gt;select&lt;/a&gt; * from tbl_autonumber;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;   &lt;div&gt;&lt;pre class="out"&gt;        ID TXT&lt;br /&gt;---------- --------------------------------------&lt;br /&gt;       1 bar&lt;br /&gt;       2 baz&lt;br /&gt;       3 qqq&lt;br /&gt;       4 ###&lt;br /&gt;       5 ???&lt;br /&gt;       6 !!!&lt;br /&gt;     111 This&lt;br /&gt;     222 should&lt;br /&gt;     333 work&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;div class="txt"&gt; .... it should be clear that it is a bad idea to supply primary keys if there is a sequence.   &lt;/div&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-116400292943418179?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/116400292943418179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/11/oracle-and-autonumber.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116400292943418179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116400292943418179'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/11/oracle-and-autonumber.html' title='Oracle and Autonumber'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-116131824891688389</id><published>2006-10-19T21:19:00.000-07:00</published><updated>2006-10-19T21:24:08.926-07:00</updated><title type='text'>How to custom define ApplicationExit Event</title><content type='html'>In the main() method, before calling the application.Start.Run() or Application.Run() methods,&lt;br /&gt;include the following line of code&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;AddHandler Application.ApplicationExit, AddressOf OnApplicationExit&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Include another method in the application as follows&lt;br /&gt;&lt;br /&gt;VB:&lt;br /&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl19VisualBasic" space="preserve"&gt;&lt;span style="color: blue;"&gt;Private&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt; OnApplicationExit(&lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: blue;"&gt;As&lt;/span&gt; &lt;span style="color: blue;"&gt;Object&lt;/span&gt;, &lt;span style="color: blue;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: blue;"&gt;As&lt;/span&gt; EventArgs)&lt;br /&gt;   &lt;span style="color: green;"&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;'your code here.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;End&lt;/span&gt; &lt;span style="color: blue;"&gt;Sub&lt;/span&gt;&lt;/pre&gt;C#:&lt;br /&gt;&lt;pre class="code" id="ctl00_LibFrame_ctl20CSharp" space="preserve"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; OnApplicationExit(object sender, EventArgs e) {&lt;br /&gt;  &lt;span style="color: green;"&gt;// Your code here.&lt;/span&gt;  &lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-116131824891688389?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/116131824891688389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/10/how-to-custom-define-applicationexit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116131824891688389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/116131824891688389'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/10/how-to-custom-define-applicationexit.html' title='How to custom define ApplicationExit Event'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115873583902061810</id><published>2006-09-19T23:44:00.000-07:00</published><updated>2006-09-20T00:17:38.503-07:00</updated><title type='text'>Could not load file or assembly 'CrystalDecisions.CrystalReports'</title><content type='html'>I managed to get hold of Visual Studio 2005, and like any new programmers, I was rubbing my hands in glee at getting the latest toolkit for development.&lt;br /&gt;&lt;br /&gt;When I tried to open an existing file in Visual Studio 2005, it prompted me to upgrade to the .NET framework and create a new webconfig file. Then my nightmare with debugging begins, especially with Crystal Reports. In particular, this error got me stumped&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#3366ff;"&gt;Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine visual studio 2005 . &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#3366ff;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#33cc00;"&gt;The error occurs in the web.config file.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&lt;em&gt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3000.0, Culture=neutral, PublicKeyToken="&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#3366ff;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3366ff;"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;I tried everything I knew, googling it, getting deployment packages from BusinessObjects etc. But none of them work as all I want is to compile my code without the darn error and make sure the migration to .NET 2.0 is successful. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So after sitting in the dark without a clue to what the error may be for an hour and fed up with reading tons of articles that don't work, I decided I have enough of googling and time to do something. As a first step, I open the bin folder, and check the Crystall report dll. Oops! There is the darn error! The version number for the old dll is 9.1.9800.9 and the assembly version is 10.2.3000.0! So I delete all the dll, and add the new CrystalReport dll.&lt;br /&gt;&lt;br /&gt;To my surprise, Visual Studio version number is higher than what the assembly version is 10.2.5150.0. Thinking myself smart, I did what I think is right and changed the assembly in the web.config file to&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.5150.0, Culture=neutral, PublicKeyToken="&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then I found out that there is no such assembly in the .NET 2.0. Only the Version 10.2.3000.0 is there in the assembly. All attempts to add the new version into the assembly failed. Since I cannot edit the assembly, I tried changing it back the original version:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&lt;em&gt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=10.2.3000.0, Culture=neutral, PublicKeyToken="&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And hey pesto, everything suddenly can compile!&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;Morale of story: Make sure your dlls in the bin directory in your new .NET 2.0 application is updated to the latest version and leave the assembly code in the web.config file alone. It saves you a lot of pain in migrating to .NET 2.0. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115873583902061810?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115873583902061810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/09/could-not-load-file-or-assembly.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115873583902061810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115873583902061810'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/09/could-not-load-file-or-assembly.html' title='Could not load file or assembly &apos;CrystalDecisions.CrystalReports&apos;'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115728731020893851</id><published>2006-09-03T05:39:00.000-07:00</published><updated>2006-09-12T06:13:39.786-07:00</updated><title type='text'>How to send Email using C#</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:verdana;"&gt;In order to send email in C# in ASP.NET 1.1., do the following:&lt;/span&gt;&lt;/span&gt; &lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;using System.Web.Mail;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;// create mail message object&lt;br /&gt;&lt;/span&gt;MailMessage mail = new MailMessage();&lt;br /&gt;mail.From = "";           // put the from address here&lt;br /&gt;mail.To = "";             // put to address here&lt;br /&gt;mail.Subject = "";        // put subject here&lt;br /&gt;mail.Body = "";           // put body of email here&lt;br /&gt;SmtpMail.SmtpServer = ""; // put smtp server you will use here&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;// and then send the mail&lt;/span&gt;&lt;br /&gt;SmtpMail.Send(mail);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:130%;"  &gt;&lt;span style="font-size:100%;"&gt;In ASP.NET 2.0, the MailMessage class and Smtp.Mail is obsoleted. Instead, you have to use the following code:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public static&lt;/span&gt; &lt;/span&gt;void CreateTestMessage4(string server)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  MailAddress&lt;/span&gt; from = new &lt;span style="color: rgb(51, 51, 255);"&gt;MailAddress&lt;/span&gt;("ben@contoso.com");&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;  MailAddress&lt;/span&gt; to = new &lt;span style="color: rgb(51, 51, 255);"&gt;MailAddress&lt;/span&gt;("Jane@contoso.com");&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;MailMessage&lt;/span&gt; message = &lt;span style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; MailMessage(from, to);&lt;br /&gt; message.Subject = "Using the SmtpClient class.";&lt;br /&gt; message.Body = @"Using this feature, you can send an e-mail message from an application very easily.";&lt;br /&gt; SmtpClient client = new SmtpClient(server);&lt;br /&gt; Console.WriteLine("Sending an e-mail message to {0} by using SMTP host {1} port {2}.",&lt;br /&gt;      to.ToString(), client.Host, client.Port);&lt;br /&gt; client.Send(message);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115728731020893851?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115728731020893851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/09/how-to-send-email-using-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115728731020893851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115728731020893851'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/09/how-to-send-email-using-c.html' title='How to send Email using C#'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115379619122783583</id><published>2006-07-24T19:55:00.000-07:00</published><updated>2006-07-24T21:03:16.663-07:00</updated><title type='text'>How to store the database connection in webconfig file in ASP.NET</title><content type='html'>&lt;span class="Article_FullDescription"&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;appsettings&gt;element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production. &lt;/appsettings&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;color:black;"&gt;As an example, let’s examine this appSetting entry in the web.config file to hold our connection string:&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&amp;lt;appsettings&amp;gt;&lt;br /&gt;&amp;lt;add key="ConnectionInfo" value="Data Source=Annapurna;Initial Catalog=ISClass;User Id=isclass;Password=isclass"&amp;gt;&lt;br /&gt;&amp;lt;appsettings&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;To read the key we use the ConfigurationSettings class from the System.Configuration namespace, as shown below. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; BACKGROUND: rgb(255,255,204) 0% 50%; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: rgb(0,0,0); PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initialfont-family:Courier New;font-size:8pt;"  &gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;12&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;private&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;void&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; Page_Load(&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;object&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;13&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;14&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;string&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; connectionInfo = ConfigurationSettings.AppSettings["ConnectionInfo"];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;15&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;using&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;(SqlConnection connection = &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;new&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; SqlConnection(connectionInfo))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;16&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;17&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;connection.Open();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;18&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;19&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,128,0); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;// perform work with connection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;20&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;21&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;22&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Some applications will duplicate these lines of code in many places. If we think about how the above code will evolve over time, we might see a handful of weaknesses. First, we have a hard coded string in place to fetch connection information from the web.config. Hard coded strings can be easy to mistype and difficult to track down if the key ever changes. Secondly, the code will tie us forever to the appSettings section of the web.config file. Although web.config is designed for just such a setting, we might find in the future that we need to pull configuration settings from a database, or change a setting from being application-wide to being a per-user configuration item kept in the Session or in a cookie. &lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Encapsulation&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Let’s abstract away the source of the connection string using a class with a static property. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; BACKGROUND: rgb(255,255,204) 0% 50%; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: rgb(0,0,0); PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initialfont-family:Courier New;font-size:8pt;"  &gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;1&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;using&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; System.Configuration;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;2&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;3&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;namespace&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; aspnet.config&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;4&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;5&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;public&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;class&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; Configuration&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;6&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;7&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;public&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;static&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;string&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; ConnectionInfo&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;8&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;9&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;get&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;10&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;11&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;return&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; ConfigurationSettings.AppSettings["ConnectionInfo"];&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;12&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;13&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;14&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;15&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;16&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Now our Page_Load method looks like the following. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; BACKGROUND: rgb(255,255,204) 0% 50%; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: rgb(0,0,0); PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initialfont-family:Courier New;font-size:8pt;"  &gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;11&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;private&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;void&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; Page_Load(&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;object&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;12&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;13&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;using&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;(SqlConnection connection = &lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,0,255); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;new&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt; SqlConnection(Configuration.ConnectionInfo))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;14&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;15&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;connection.Open();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;16&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;17&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; COLOR: rgb(0,128,0); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;// perform work with connection&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;18&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;19&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="BACKGROUND: rgb(255,255,255) 0% 50%; COLOR: rgb(0,128,128); moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;20&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,255,204) 0% 50%; moz-background-clip: -moz-initial; moz-background-origin: -moz-initial; moz-background-inline-policy: -moz-initial"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The changes we made to the above code were relatively small - but powerful. Now the Page_Load function doesn’t know where the connection string comes from. We could easily change the ConnectionInfo property to retrieve the string from a different source without modifying any other code in the application. We also no longer have to remember the key string and hard code the string at various points in the application. Instead, we can utilize Visual Studio Intellisense when accessing the Configuration class to find the setting we need. The key value only appears once – inside the ConnectionInfo property – so we could again change the key name in the web.config and have only one line of code to update. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Of course this approach only works if all of the code in the application goes to the Configuration class instead of directly to web.config to retrieve settings. For each appSetting entry added to web.config we would add a corresponding property to the Configuration class. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Another advantage to this approach becomes apparent if we have an application setting that is not a string, but a date, integer, or other primitive type. In this case we could have the corresponding Configuration property parse the string from the web.config file and return the appropriate type. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;You’ll notice we provided a read-only property for ConnectionInfo. The web.config file is not designed for constant updates. When an ASP.NET application launches a watch is put on the web.config file. ASP.NET will detect if the web.config changes while the application is running. When ASP.NET detects a change it will spin up a new version of the application with the new settings in effect. Any in process information, such as data kept in Session, Application, and Cache will be lost (assuming session state is InProc and not using a state server or database). &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115379619122783583?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115379619122783583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-to-store-database-connection-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115379619122783583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115379619122783583'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-to-store-database-connection-in.html' title='How to store the database connection in webconfig file in ASP.NET'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115286355475817859</id><published>2006-07-14T00:52:00.000-07:00</published><updated>2006-07-14T00:52:34.950-07:00</updated><title type='text'>How to Enter Symbols into Window Forms or ASP.NET web pages</title><content type='html'>&lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Letters with Accents&lt;/span&gt;&lt;/h2&gt;         &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;This list is organized by &lt;b&gt;Accent&lt;/b&gt; type. To determine the appropriate        numeric code, match the accent with the vowel.&lt;/span&gt;&lt;/p&gt;               &lt;table class="vowelcode"  border="0" cellpadding="5" cellspacing="0" style="font-family:verdana;"&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th class="midblue" scope="col"&gt;&lt;span style="font-size:85%;"&gt;Accent&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;A&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;E&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;I&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;O&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;U&lt;/span&gt;&lt;/th&gt;         &lt;th class="thv" scope="col"&gt;&lt;span style="font-size:85%;"&gt;Y&lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="line" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Grave&lt;span class="hiddenv"&gt;&lt;br /&gt;    (Cap)&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;À&lt;/b&gt;&lt;br /&gt;    0192&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;È&lt;/b&gt;&lt;br /&gt;    0200&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ì&lt;/b&gt;&lt;br /&gt;    0204&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ò&lt;/b&gt;&lt;br /&gt;    0210&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ù&lt;/b&gt;&lt;br /&gt;    0217&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="hiddenv" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Grave (Lower)&lt;/span&gt;&lt;/th&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;à&lt;/b&gt;&lt;br /&gt;    0224&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;è&lt;/b&gt;&lt;br /&gt;    0232&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ì&lt;/b&gt;&lt;br /&gt;    0236&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ò&lt;/b&gt;&lt;br /&gt;    0242&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ù&lt;/b&gt;&lt;br /&gt;    0249&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="line" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Acute &lt;span class="hiddenv"&gt;&lt;br /&gt;    (Cap)&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Á&lt;/b&gt;&lt;br /&gt;    0193&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;É&lt;/b&gt;&lt;br /&gt;    0201&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Í&lt;/b&gt;&lt;br /&gt;    0205&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Ó&lt;/b&gt;&lt;br /&gt;    0211&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Ú&lt;/b&gt;&lt;br /&gt;    0218&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Ý&lt;/b&gt;&lt;br /&gt;    0221&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="hiddenv" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Acute (Lower)&lt;/span&gt;&lt;/th&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;á&lt;/b&gt;&lt;br /&gt;    0225&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;é&lt;/b&gt;&lt;br /&gt;    0233&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;í&lt;/b&gt;&lt;br /&gt;    0237&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;ó&lt;/b&gt;&lt;br /&gt;    0243&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;ú&lt;/b&gt;&lt;br /&gt;    0250&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;ý&lt;/b&gt;&lt;br /&gt;    0253&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="line" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Circumflex&lt;br /&gt;&lt;span class="hiddenv"&gt;(Cap)&lt;/span&gt;&lt;/span&gt;             &lt;/th&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Â&lt;/b&gt;&lt;br /&gt;    0194&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ê&lt;/b&gt;&lt;br /&gt;    0202&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Î&lt;/b&gt;&lt;br /&gt;    0206&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ô&lt;/b&gt;&lt;br /&gt;    0212&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Û&lt;/b&gt;&lt;br /&gt;    0219&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="hiddenv" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Circumflex (Lower)&lt;/span&gt;&lt;/th&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;â&lt;/b&gt;&lt;br /&gt;    0226&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ê&lt;/b&gt;&lt;br /&gt;    0234&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;î&lt;/b&gt;&lt;br /&gt;    0238&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ô&lt;/b&gt;&lt;br /&gt;    0244&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;û&lt;/b&gt;&lt;br /&gt;    0251&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="line" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Tilde&lt;br /&gt;&lt;span class="hiddenv"&gt;(Cap)&lt;/span&gt;&lt;/span&gt;             &lt;/th&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Ã&lt;/b&gt;&lt;br /&gt;    0195&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;--&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Ñ&lt;/b&gt;&lt;br /&gt;    0209&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;Õ&lt;/b&gt;&lt;br /&gt;    0213&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;-- &lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="hiddenv" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Tilde (Lower)&lt;/span&gt;&lt;/th&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;ã&lt;/b&gt;&lt;br /&gt;    0227&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;--&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;ñ&lt;/b&gt;&lt;br /&gt;    0241&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark serif"&gt;õ&lt;/b&gt;&lt;br /&gt;    0245&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;-- &lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="line" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Umlaut &lt;span class="hiddenv"&gt;&lt;br /&gt;    (Cap)&lt;/span&gt;&lt;/span&gt;&lt;/th&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ä&lt;/b&gt;&lt;br /&gt;    0196&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ë&lt;/b&gt;&lt;br /&gt;    0203&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ï&lt;/b&gt;&lt;br /&gt;    0207&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ö&lt;/b&gt;&lt;br /&gt;    0214&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ü&lt;/b&gt;&lt;br /&gt;    0220&lt;/span&gt;&lt;/td&gt;         &lt;td class="line"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;Ÿ&lt;/b&gt;&lt;br /&gt;    0159&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;th class="hiddenv" scope="row"&gt;&lt;span style="font-size:85%;"&gt;Umlaut (Lower)&lt;/span&gt;&lt;/th&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ä&lt;/b&gt;&lt;br /&gt;    0228&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ë&lt;/b&gt;&lt;br /&gt;    0235&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ï&lt;/b&gt;&lt;br /&gt;    0239&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ö&lt;/b&gt;&lt;br /&gt;    0246&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ü&lt;/b&gt;&lt;br /&gt;    0252&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="serif"&gt;ÿ&lt;/b&gt;&lt;br /&gt;    0255&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;Example: &lt;/b&gt;To input the acute a &lt;b&gt;á&lt;/b&gt; &lt;b&gt; (0225)&lt;/b&gt;, hold        down the &lt;b&gt;ALT&lt;/b&gt; key, type &lt;b&gt;0225 &lt;/b&gt;on the numeric keypad, then release        the &lt;b&gt;ALT&lt;/b&gt; key.&lt;/span&gt;&lt;/p&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;If you are having problems inputting these codes, please review the instructions        for using the codes at the bottom of this Web page.&lt;/span&gt;&lt;/p&gt;         &lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="foreign"&gt;&lt;/a&gt;Other Foreign Characters&lt;/span&gt;&lt;/h2&gt;   &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;These include special punctuation and unique consonant and vowel symbols.&lt;/span&gt;&lt;/p&gt;              &lt;table class="chart"  border="0" cellpadding="5" cellspacing="0" style="font-family:verdana;"&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th scope="col" class="midblue"&gt;&lt;span style="font-size:85%;"&gt;SYMBOL&lt;/span&gt;&lt;/th&gt;          &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;NAME&lt;/span&gt;&lt;/th&gt;              &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;CODE NUMBER &lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;            &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;¡&lt;/span&gt;&lt;/div&gt;         &lt;/td&gt;         &lt;td width="40%"&gt;&lt;span style="font-size:85%;"&gt;Upside-down exclamation mark&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0161&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¿&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Upside-down question mark&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0191&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Ç, ç&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;French C cedille (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0199&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0231&lt;/b&gt;&lt;/span&gt;        &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Œ,œ&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;O-E ligature (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0140&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0156&lt;/b&gt;&lt;/span&gt;        &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ß&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;German Sharp/Double S&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0223&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Ø,ø&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Nordic O slash (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0216&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0248&lt;/b&gt;&lt;/span&gt;        &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Å,å&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Nordic A ring (caps/lowecase), Angstrom sign&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0197&lt;br /&gt;      &lt;/b&gt;&lt;b class="tealdark"&gt;0229&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Æ, æ&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;A-E ligature (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0198&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0230&lt;/b&gt;&lt;/span&gt;            &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Þ, þ&lt;/span&gt;&lt;/td&gt;          &lt;td&gt;&lt;span style="font-size:85%;"&gt;Icelandic/Old English Thorn (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0222&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0254&lt;/b&gt;&lt;/span&gt;        &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; Ð, ð&lt;/span&gt;&lt;/td&gt;          &lt;td&gt;&lt;span style="font-size:85%;"&gt;Icelandic/Old English Eth (caps/lowecase)&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0208&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0240&lt;/b&gt;&lt;/span&gt;            &lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; « »&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Spanish/French quotation marks&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0187&lt;/b&gt;&lt;br /&gt;&lt;b class="tealdark"&gt;0171&lt;/b&gt;&lt;/span&gt;            &lt;/td&gt;       &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;          &lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="currency"&gt;&lt;/a&gt;Currency Symbols&lt;/span&gt;&lt;/h2&gt;         &lt;table class="chart"  border="0" cellpadding="5" cellspacing="0" style="font-family:verdana;"&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th scope="col" class="midblue"&gt;&lt;span style="font-size:85%;"&gt;SYMBOL&lt;/span&gt;&lt;/th&gt;          &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;NAME&lt;/span&gt;&lt;/th&gt;         &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;CODE NUMBER&lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¢&lt;/span&gt;&lt;/td&gt;         &lt;td width="40%"&gt;&lt;span style="font-size:85%;"&gt;Cent sign&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0162&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; £&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;British Pound&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0163&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; €&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Euro currency &lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0128&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¥&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Japanese Yen&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0165&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;         &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ƒ&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Dutch Florin &lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0131&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¤&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Generic currency symbol&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0164&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;     &lt;p class="anav"  style="font-family:verdana;"&gt; &lt;span style="font-size:85%;"&gt;&lt;a href="http://tlt.psu.edu/suggestions/international/accents/codealt.html#top"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;     &lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="math"&gt;&lt;/a&gt;Math Symbols&lt;/span&gt;&lt;/h2&gt;         &lt;table class="chart"  border="0" cellpadding="5" cellspacing="0" style="font-family:verdana;"&gt;       &lt;tbody&gt;&lt;tr&gt;         &lt;th scope="col" class="midblue"&gt;&lt;span style="font-size:85%;"&gt;SYMBOL&lt;/span&gt;&lt;/th&gt;         &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;NAME&lt;/span&gt;&lt;/th&gt;         &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;CODE NUMBER&lt;/span&gt;&lt;/th&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ÷&lt;/span&gt;&lt;/td&gt;         &lt;td width="40%"&gt;&lt;span style="font-size:85%;"&gt;Division sign&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;  &lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0247&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; °&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Degree symbol&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0176&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¬&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Not symbol&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0172&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ±&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Plus/minus&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0177&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;       &lt;tr&gt;          &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; µ&lt;/span&gt;&lt;/td&gt;         &lt;td&gt;&lt;span style="font-size:85%;"&gt;Micro&lt;/span&gt;&lt;/td&gt;         &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0181&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;       &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;           &lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="punc"&gt;&lt;/a&gt;Other Punctuation &lt;/span&gt;&lt;/h2&gt;   &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;These incude copyright symbols and special section marks.&lt;/span&gt;&lt;/p&gt;            &lt;table class="chart"  border="0" cellpadding="5" cellspacing="0" style="font-family:verdana;"&gt;     &lt;tbody&gt;&lt;tr&gt;        &lt;th scope="col" class="midblue"&gt;&lt;span style="font-size:85%;"&gt;SYMBOL&lt;/span&gt;&lt;/th&gt;       &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;NAME&lt;/span&gt;&lt;/th&gt;       &lt;th scope="col"&gt;&lt;span style="font-size:85%;"&gt;CODE NUMBER&lt;/span&gt;&lt;/th&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ©&lt;/span&gt;&lt;/td&gt;       &lt;td width="40%"&gt;&lt;span style="font-size:85%;"&gt;Copyright symbol&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0169&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ®&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;Registered symbol&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0174&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ™&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;Trademark&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0153&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; •&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;List Dot&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0149&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; §&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;Section Symbol&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0167&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; –&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;en-dash&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0150&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; —&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;em-dash&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0151&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;        &lt;td class="mightyglyphserif"&gt;&lt;span style="font-size:85%;"&gt; ¶&lt;/span&gt;&lt;/td&gt;       &lt;td&gt;&lt;span style="font-size:85%;"&gt;Paragraph Symbol&lt;/span&gt;&lt;/td&gt;       &lt;td align="center"&gt;&lt;span style="font-size:85%;"&gt;&lt;b class="tealdark"&gt;0182&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/p&gt;        &lt;h2  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;a name="using"&gt;&lt;/a&gt;Using the Codes&lt;/span&gt;&lt;/h2&gt;         &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;Windows assigns a numeric code to different accented        letters, other foreign characters and special mathematical symbols. For        instance the code for lower case &lt;b&gt;á&lt;/b&gt; is &lt;b&gt;0225&lt;/b&gt;, and the        code for capital &lt;b&gt;Á&lt;/b&gt; is 0193. The ALT key input is used to manually        insert these letters and symbols by calling the numeric code assigned to        them. &lt;/span&gt;&lt;/p&gt;     &lt;p  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt;To use the codes:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;     &lt;ol&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;        Place your cursor in the location where you wish to insert a special        character.&lt;/span&gt;&lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;        Activate the &lt;b&gt;numeric key pad&lt;/b&gt; on the right of the keyboard by            pressing &lt;b&gt;Num Lock&lt;/b&gt; (upper right of keyboard). The&lt;b&gt; Num Lock&lt;/b&gt;          light on the keyboard will indicate that the numeric key pad is on.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt; You must use the numeric key pad; if you use the number            keys on the top of the keyboard, the characters will not appear. If            you are on a &lt;b&gt;laptop&lt;/b&gt; or computer without a separate numeric keypad,        other methods are recommended.&lt;/span&gt;                  &lt;/li&gt;&lt;li  style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;        While pressing down the &lt;b&gt;ALT &lt;/b&gt;key, type the four-digit code on            the &lt;b&gt;numeric key pad&lt;/b&gt; at the right edge of the keyboard. The codes            are "case sensitive." For instance, the code for lower-case &lt;b&gt;á&lt;/b&gt; is &lt;b&gt;ALT+0225&lt;/b&gt;, but capital &lt;b&gt;Á&lt;/b&gt; is &lt;b&gt;ALT+0193&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NOTE:&lt;/b&gt; If you have the International keyboard            activated, you will only be able to input codes with the &lt;b&gt;ALT&lt;/b&gt;          key on the left side of the keyboard.&lt;br /&gt;&lt;/span&gt;                         &lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt; Release the &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;ALT&lt;/b&gt;&lt;span style="font-family:verdana;"&gt; key. The character will appear when the &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;ALT&lt;/b&gt;&lt;span style="font-family:verdana;"&gt;          key is released.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style="font-family: verdana;"&gt;NOTE: &lt;/b&gt;&lt;span style="font-family:verdana;"&gt;You must &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;include the initial zero&lt;/b&gt;&lt;span style="font-family:verdana;"&gt; in the code. For          example to insert &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;á&lt;/b&gt;&lt;span style="font-family:verdana;"&gt; &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;(0225)&lt;/b&gt; you must type &lt;b style="font-family: verdana;"&gt;ALT+0225&lt;/b&gt;&lt;span style="font-family:verdana;"&gt;,          NOT &lt;/span&gt;&lt;b style="font-family: verdana;"&gt;ALT+225&lt;/b&gt;&lt;span style="font-family:verdana;"&gt;.&lt;/span&gt;&lt;/span&gt;                   &lt;/li&gt;&lt;/ol&gt;      &lt;p class="anav"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115286355475817859?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115286355475817859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-to-enter-symbols-into-window-forms_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115286355475817859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115286355475817859'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-to-enter-symbols-into-window-forms_14.html' title='How to Enter Symbols into Window Forms or ASP.NET web pages'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115277385733586604</id><published>2006-07-12T23:45:00.000-07:00</published><updated>2006-07-13T00:04:07.120-07:00</updated><title type='text'>How do I enter a null date into the database?</title><content type='html'>&lt;span style="color: rgb(0, 153, 0);"&gt;Make sure that the System.Data.Namespace is included. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;include System.Data.SqlType;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;In the command parameters to be parsed into database, use SqlDateTime.Null: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr&gt;&lt;br /&gt;&lt;td&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;public void &lt;/span&gt;InsertDateOfBirth(&lt;span style="color: rgb(51, 51, 255);"&gt;string&lt;/span&gt; Date1){&lt;br /&gt;  SqlConnection cn  = new SqlConnection();&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;string &lt;/span&gt;sqlstring = "Insert into Database1 values (@birthday)";&lt;br /&gt;  SqlCommand cmd = new SqlCommand(sqlstring, cn);&lt;br /&gt;  cmd.Parameters.Add("@birthday", SqlDbType.DateTime);&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;       &lt;span style="color: rgb(51, 51, 255);"&gt;try  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;  {&lt;br /&gt;           cmd.Parameters["@birthday"].Value = DateTime.Parse(Date1);&lt;br /&gt;  }&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt; catch&lt;/span&gt; (Exception er)&lt;br /&gt;  {&lt;br /&gt;             cmd.Parmeters["@birthday"].Value = SqlDateTime.null;  &lt;br /&gt;  }&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt; try&lt;/span&gt;&lt;br /&gt; {&lt;br /&gt; cn.Open();&lt;br /&gt; cmd.ExecuteNonQuery();&lt;br /&gt; cn.Close();&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;catch&lt;/span&gt; (SqlException sqlerror)&lt;br /&gt;{&lt;br /&gt;           Console.WriteLine(sqlerror.Message);&lt;br /&gt; }&lt;br /&gt; &lt;span style="color: rgb(51, 51, 255);"&gt;catch &lt;/span&gt;(Exception er1)&lt;br /&gt;{&lt;br /&gt;            Console.WriteLine(er1.Message);&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115277385733586604?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115277385733586604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-do-i-enter-null-date-into-database.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115277385733586604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115277385733586604'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/how-do-i-enter-null-date-into-database.html' title='How do I enter a null date into the database?'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115202924620454973</id><published>2006-07-04T09:07:00.000-07:00</published><updated>2006-07-05T07:56:41.763-07:00</updated><title type='text'>Common Project Management Pitfalls part 1</title><content type='html'>&lt;hr /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold; font-style: italic;"&gt;&lt;br /&gt;This is a multi-part article about common project  management pitfalls.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:verdana;font-size:85%;"  &gt;Why is it that for most IT Projects, it is often difficult to meet the projected  datelines, and deliver the system within time, budget and specification  constraits? Indeed, as any project manager who is worth their weight in salt can  testify, IT projects seldom, if ever meets the dateline, budge and  specification. In fact, a study by the Standish Group Report (1995) shows that  some 83.8% of projects are either challenged (the project is completed, but  over-budgeted, over time-estimated or offers fewer features and functions than  originally specified) or impaired (the project is canceled at some point during  the development cycle). This has lead many project managers to dispair when  things failed to go their way. What are the common causes of this problem?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;Project  objectives not fully specified / Poor Communications&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Surprisingly, a study by Pete  Marwick (1998) found that 51% of projects planning fails because the project  objectives is not fully specified and poor communication between the client and the system analyst. There are many reasons why the project  objectives are not fully specified or well-detailed. Below list some of the common pitfalls that lead to project failure under this catergory.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;  &lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-family:verdana;font-size:85%;"  &gt;  Lack of Project Methodology to plan the deliverables&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Project Methodology refers to the  way in which the project is done. Most software development projects follow   a project life cycle - the collection of project phases. A Software   Development Life Cycle is a framework for describing the phases involved in   developing and maintaining information systems. It provides a consistent and   effective approach for undertaking projects. Without a clear Project   Methodology or Software Development Life Cycle, it is difficult to   impossible to plan for a job.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;" &gt;&lt;br /&gt;A clear framework or Software Development Life Cycle model to follow makes   it easy for programmers and IT consultants to understand the job scope, and   what the deliverables are at each stage. For instance, at the Requirements   Specification phases in the waterfall model, the deliverables are all the   requirements of the system, sample user interfaces, and the flow of events   (sequence diagrams, event diagrams or flowcharts). With a clearly defined   project objectives signed by both parties, it makes it easier to agree on   the project objectives. Without doubt, one of the first objective of any   solid project management plan is to plan for and agree on the project   requirements.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;  &lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Analyst failed to   understand client's requirements and understand client's needs.&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;It is my opinion that the planning   and agreeing on the project requirements phases is the  &lt;span style="font-weight: bold; font-style: italic; color: rgb(204, 0, 0);"&gt;  most important part &lt;/span&gt;of the project life cycle. Finding out why the   client wants a system, what type of system he is looking for, what type of   software/hardware he needs is one of the most critical stages in the   software development phases. By understanding the needs of your clients and   putting it in writing, you can constantly review if the design of the UI   meets their needs. Gathering information such as samples of previous work,   documentations, interviews, surveys and other information prior to starting   the work is essential to confirm what you will be doing, and scope of the   project. Many project manager failed to see this as the most important part   of the project, and allocated too little time to this phase.  &lt;span style="font-weight: bold; color: rgb(255, 0, 0); font-style: italic;"&gt;  How are you going to plan and propose an effective system for your clients   if you do not understand what is required?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Do allow at least 1 week to ensure that you understand all the   documentations and process involved in the system, and the job scope. Only   and only then can you begin to plan how long the project will take.&lt;br /&gt;&lt;br /&gt;One good way of ensuring that you understand your client's business process   is to draft a flowchart of the sequence of diagrams for each process. By   doing so, you are confirming what you think is the way the process work   against what the process actually work. Most clients happily point out your   mistakes, so present your findings and ask them to clarify any doubtful   points. Once there are no more obstacles, get your client to sign the   documentation confirming that is the actual flow of events.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;  &lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-family:verdana;font-size:85%;"  &gt;  User Design is not what the clients wants...&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;Once the scope of project is confirmed, the next most important item is to   draft the user interface. Those who just jump straight into programming   without a drafting the user interface is in for a lot of re-coding work -   especially when your user interface is flatly rejected by the client later   on. Your user interface speaks volume of what you think what the clients   want and need against what he actually needs. By providing a good user   interface, both of you are agreeing on the scope of the work, and how the   data should be presented. &lt;/span&gt;  &lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;The client should   sign off the user interfaces to show that he accepted the UI design.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;  &lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Failure to check   with client the actual data stored &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next most essential phase of the project is the design phases. Before   you go on to conduct class diagrams, sequence diagrams etc, the first thing   you need to do is to design the database first. The database should take in   account all fields in the UI design. The primary key, a description of key   flags (e.g. status: p = pending, c = completed, a = approved, r= rejected),   and any foreign keys should be identified. Each table should have a short   description of what information it stores. Finally relationship diagram   should be drawn for easy referencing. By confirming with your client what   type data are actually stored and can be retrieved, it helps to prevent   problems later on, especially when they need some more data that is not   stored (believe me, this is darn common).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Planning the Project   Timeline.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once all documentations above has been signed off, only and only then can   the project datelines, deliverables and budget be planned and controlled   with any good chance of completing the project on time and on budget, with   all features and functions as initially specified. A common mistake many new   project manager makes is to break down the work structure accordingly to   phases in the Software Development Lifecycle. While this provides a good   overview of what is to be done, it is at best, fairly inaccurate. The   project manager should instead further breakdown the work into sections, and   allow some time for each sections. For instance, the work involved requires   some 30 User Interfaces screen. Planning 1-2 days for each UI for a 3 tier   development for each staff assigned helps to paint a more accurate picture   of the time required for documentation and programming.&lt;br /&gt;&lt;br /&gt;The client should be informed of the project plan and sign off the agreement   on datelines of the project. Also, it is a good communication practice to   inform and update the client on project progress status on a weekly basis.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;  &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;  &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Documentation and   Designing the Sequences Diagram, Class Diagram, Event Diagrams&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At this point, the next key step is to draft all the documentation. The   sequence diagram, class diagram and event diagrams should be planned and   documented prior to coding. By documenting how each class is related to one   another, and planning for a 3 tier architecture, you are ensuring   reusibility of class, and saving time on programming. &lt;/span&gt;  &lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;Also, by doing   this, you are insuring yourself against changes in business logic or   database structure. When such change are required, they can be implemented   with minimum effort by identifying which classes are affected by the   changes.&lt;br /&gt;&lt;br /&gt;Many programmers hate this step and in some companies, this step is often   left until all the programming has been done.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana;font-size:85%;"  &gt;  &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Frequent changes to   the project specification&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Let's face it, the client is human too,   and human has a tendency to change their mind. The worse clients are those   who have no clue to what they want and frequently change their mind -   because once the system is coded and development is under way, the system is   often inflexible and the changes to the coding or database are often tedious   and time-consuming. This is especially so when a small change in code or   database can lead to all sorts of bugs can pop out elsewhere in the program,   and tons of re-editing the documentations is required. By getting the work   flow, user interface and database signed off, you are protecting yourself   against any changes to project specifications. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Should your client insist on the changes   after all the specifications have been signed off - it is best to evaluate   if the change can be implemented with minimum inconvenience. This is where   all the documentations come in handy - review the documentation to see if the changes will affect several classes or isolated to one or two classes. If the changes can be implemented with minimum effort, it should be incorporated into the system - building a good relationship with a client is important.   However, if the changes required is medium to heavy in effort, it is often   required to politely but firmly inform the client that these changes are not in the   requirements, as per the signed off UI, database and project plan, but you   can implement them for an added fee - it is not good business to engage in a losing preposition. Also, there will be a delay in schedule   to accommodate the changes required. Often the increase in budget and delay   in delivering the system will make the client think twice if the changes to   be implemented are essential or just a whim on his side. Even if the changes   is to be incorporated into the system, there is some benefit for your   organization in terms of increased timeline and profits.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;span style=";font-family:Verdana;font-size:85%;"  &gt;In the next part of this series, I will cover the  common pitfalls of bad planning and estimating. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115202924620454973?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115202924620454973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/common-project-management-pitfalls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115202924620454973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115202924620454973'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/common-project-management-pitfalls.html' title='Common Project Management Pitfalls part 1'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115198936212778167</id><published>2006-07-03T21:59:00.000-07:00</published><updated>2006-07-03T22:02:42.136-07:00</updated><title type='text'>Sun Java IDE</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Sun Java developers new  IDE (Integrated Developer Environment)  is available for FREE at &lt;a title="http://developers.sun.com/prodtech/javatools/jsenterprise/index.jsp" href="http://developers.sun.com/prodtech/javatools/jsenterprise/index.jsp"&gt;http://developers.sun.com/prodtech/javatools/jsenterprise/index.jsp&lt;/a&gt;  :)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;It automatically creates class diagrams, UML, sequence diagrams, with  intellisense (Java Version) + UI design and best of all, it is  free! It comes with a neat, easy to use  UI for developing JSP, EJB code quickly and effectively.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115198936212778167?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115198936212778167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/sun-java-ide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115198936212778167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115198936212778167'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/sun-java-ide.html' title='Sun Java IDE'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115175409642497179</id><published>2006-07-01T04:24:00.000-07:00</published><updated>2006-07-01T04:41:36.436-07:00</updated><title type='text'>Connection Strings</title><content type='html'>&lt;span style="font-size:85%;"&gt;These connection strings are for .NET programming environment which can be connected to a wide variety of database. Below are some of most common connection strings&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;MSSQL Server &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;SQLServer&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;"Data Source=&lt;span style="color: rgb(0, 102, 0);"&gt;MSSQLServerName&lt;/span&gt;;Initial Catalog=&lt;span style="color: rgb(0, 102, 0);"&gt;Northwind&lt;/span&gt;;User Id=&lt;span style="color: rgb(0, 102, 0);"&gt;id&lt;/span&gt;;Password=&lt;span style="color: rgb(0, 102, 0);"&gt;password&lt;/span&gt;;"      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;OleDbServer&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;"Provider=sqloledb;Data Source=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;span style="color: rgb(0, 102, 0);"&gt;MSSQLServerName&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;;Initial Catalog=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Northwind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;;User Id=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;span style="color: rgb(0, 102, 0);"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;;Password=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveradonet" style="cursor: default;"&gt;&lt;span style="font-family: verdana;font-size:85%;" &gt;&lt;span style="color: rgb(0, 102, 0);"&gt;password&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-size:100%;" &gt;MS Access&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;Standard &lt;/span&gt;&lt;span style="" id="access"&gt;&lt;span id="jetoledb" style="cursor: default;"&gt;      &lt;br /&gt;"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&lt;span style="color: rgb(0, 102, 0);"&gt;\somepath\mydb.mdb&lt;/span&gt;;User Id=&lt;span style="color: rgb(0, 102, 0);"&gt;admin&lt;/span&gt;;Password=;"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;With Password&lt;/span&gt;&lt;span style="" id="access"&gt;&lt;span id="jetoledb" style="cursor: default;"&gt;&lt;div&gt;      "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&lt;span style="color: rgb(0, 102, 0);"&gt;\somepath\mydb.mdb&lt;/span&gt;;Jet OLEDB:Database Password=&lt;span style="color: rgb(0, 102, 0);"&gt;MyDbPassword&lt;/span&gt;;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="sqlserver"&gt;&lt;span id="sqlserveroledb" style="cursor: default;"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;font-size:100%;" &gt;Oracle&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;ODBC&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="oracle"&gt;&lt;span id="oracleodbc" style="cursor: default;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="oracle"&gt;&lt;span id="oracleodbc" style="cursor: default;"&gt;"Driver={Microsoft ODBC for Oracle}; Server=&lt;span style="color: rgb(0, 102, 0);"&gt;OracleServer.world&lt;/span&gt;; Uid=&lt;span style="color: rgb(0, 102, 0);"&gt;Username&lt;/span&gt;;Pwd=&lt;span style="color: rgb(0, 51, 0);"&gt;password&lt;/span&gt;;"&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="" id="oracle"&gt;&lt;span id="oracleodbc" style="cursor: default;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;&lt;span style="font-size:85%;"&gt;OLE DB&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="" id="oracle"&gt;&lt;span id="oracleadonet" style="cursor: default;"&gt;"Data Source=&lt;span style="color: rgb(0, 102, 0);"&gt;MyOracleDB&lt;/span&gt;;User Id=&lt;span style="color: rgb(0, 153, 0);"&gt;username&lt;/span&gt;;Password=&lt;span style="color: rgb(0, 153, 0);"&gt;passwd&lt;/span&gt;;Integrated Security=no;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;MySQL&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;OLE DB &lt;/span&gt;&lt;br /&gt;&lt;span style="" id="mysql"&gt;&lt;span id="mysqloledb" style="cursor: default;"&gt;      "Provider=MySQLProv;Data Source=mydb;User Id=UserName;Password=asdasd;"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115175409642497179?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115175409642497179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/07/connection-strings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115175409642497179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115175409642497179'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/07/connection-strings.html' title='Connection Strings'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115164367245010167</id><published>2006-06-29T21:42:00.000-07:00</published><updated>2006-06-29T23:54:09.113-07:00</updated><title type='text'>ASP .NET 1.1 Upload Files</title><content type='html'>&lt;span style="font-size:85%;"&gt;In ASP.NET framework 1.1, the html control &lt;input id="uplTheFile" style="WIDTH: 300px; HEIGHT: 22pxfont-size:28px;" type="file"  runat="server"&gt; can be represented by the tags &lt; id="uploadfile" type= "file" runat="server"&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;span style="COLOR: rgb(102,0,0);" &gt;Sample Code&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="COLOR: rgb(0,153,0)"&gt;//Check that the file is not null&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;/span&gt;if (uploadfile.PostedFile != null)&lt;br /&gt;{&lt;br /&gt;&lt;span style="COLOR: rgb(0,153,0)"&gt;// process the post file logic here.&lt;br /&gt;&lt;br /&gt;//Example of saving the file as another file&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,0)"&gt;&lt;span style="COLOR: rgb(51,51,255)"&gt;this&lt;/span&gt;.uploadfile.PostedFile.SaveAs("C:\filename");&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,153,0)"&gt;//Example of getting the name of the file &lt;/span&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(0,0,153)"&gt;&lt;span style="COLOR: rgb(51,51,255)"&gt;string&lt;/span&gt;&lt;/span&gt; filename = System.IO.Path.GetFileName(&lt;span style="COLOR: rgb(51,51,255)"&gt;this&lt;/span&gt;.uploadfile.PostedFile.FileName);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;But the catch of this method is that the file size is limited to 4 MB. In .NET framework 2.0, this file size can be adjusted easily. However, .NET 1.1 framework users have to add this line in the web.config file&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="TEXT-ALIGN: center"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="COLOR: rgb(0,102,0)"&gt;&lt;httpruntime&gt;&lt;span style="COLOR: rgb(51,51,255)"&gt;&lt;httpruntime&gt;&lt;br /&gt;&lt; &lt;span style="color:#990000;"&gt;httpRuntime &lt;/span&gt;="10000" &lt;span style="COLOR: rgb(51,51,255);" &gt;executionTimeout&lt;/span&gt;="54000" &lt;span style="COLOR: rgb(0,153,0)"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/httpruntime&gt;&lt;/span&gt;&lt;div style="TEXT-ALIGN: left"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;This will increase the lenght of the file to 10 MB (recommended not more than 20 MB) and increase the time allowed to process the bigger file accordingly.&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115164367245010167?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115164367245010167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/06/asp-net-11-upload-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115164367245010167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115164367245010167'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/06/asp-net-11-upload-files.html' title='ASP .NET 1.1 Upload Files'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115139254127300152</id><published>2006-06-27T00:01:00.000-07:00</published><updated>2006-06-27T00:15:41.283-07:00</updated><title type='text'>Downloading Files</title><content type='html'>&lt;span style="font-size:85%;"&gt;The following block of code allows you to download files automatically to the user desktop&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;//Open the file&lt;/span&gt;&lt;br /&gt;FileStream fs = File.Open(@"C:\filename.txt", FileMode.Open);&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;//Create a btye array&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;            byte&lt;/span&gt;[] bytBytes = new &lt;span style="color: rgb(51, 51, 255);"&gt;byte&lt;/span&gt;[fs.Length];&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;            try&lt;/span&gt;&lt;br /&gt;      {&lt;br /&gt;  &lt;span style="color: rgb(0, 153, 0);"&gt;//find the length of the file and read the file&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(51, 102, 255);"&gt;string&lt;/span&gt; longint = fs.Length.ToString();&lt;br /&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;int &lt;/span&gt;temp = int.Parse(longint);&lt;br /&gt;  fs.Read(bytBytes, 0, temp);&lt;br /&gt;  fs.Close();&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;//Parse the file so that it will be download to user's desktop&lt;/span&gt;&lt;br /&gt; Response.AddHeader("Content-disposition", "attachment; filename=C:\filename.txt")&lt;br /&gt; Response.ContentType = "application/octet-stream";&lt;br /&gt; Response.BinaryWrite(bytBytes);&lt;br /&gt; Response.End();&lt;br /&gt;      }&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;            catch&lt;/span&gt; (Exception er)&lt;br /&gt;      {&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;  //In event of error&lt;/span&gt;&lt;br /&gt;  fs.Close();&lt;br /&gt;  Console.WriteLine(er.Message);&lt;br /&gt;      } &lt;/span&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115139254127300152?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115139254127300152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/06/downloading-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115139254127300152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115139254127300152'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/06/downloading-files.html' title='Downloading Files'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115137518397662963</id><published>2006-06-26T19:21:00.000-07:00</published><updated>2006-06-29T23:55:05.466-07:00</updated><title type='text'>Regular Expression Testing Tools</title><content type='html'>&lt;span style="font-size:85%;"&gt;These tools allow you to test your regular expression syntax before you summit them, eliminating a lot of guesswork. If you are a newbie regular expression coder, these tools are a godsent. Since I often use regular expression, these tools are awesome for me. Perhaps I should try and develope a regular expression tester myself... :P, it is not too difficult.&lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="COLOR: rgb(204,0,0)"&gt;Dot Net Coders&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;It is free and it works well with .NET syntax&lt;br /&gt;&lt;a href="http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx"&gt;http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115137518397662963?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115137518397662963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/06/regular-expression-testing-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115137518397662963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115137518397662963'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/06/regular-expression-testing-tools.html' title='Regular Expression Testing Tools'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115133094054047461</id><published>2006-06-26T06:50:00.000-07:00</published><updated>2006-06-26T07:19:03.550-07:00</updated><title type='text'>Regular Expression Syntax Reference</title><content type='html'>&lt;hr /&gt; &lt;table border="1" cellpadding="4" cellspacing="0"&gt; &lt;tbody&gt;&lt;tr style="color: rgb(204, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Characters&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Any character except &lt;tt&gt;[\^$.|?*+()&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;All characters except the listed special characters match a single instance of themselves.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a&lt;/tt&gt; matches &lt;tt class="match"&gt;a&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\&lt;/tt&gt; (backslash) followed by any of &lt;tt&gt;[\^$.|?*+()&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;A backslash escapes special characters to suppress their special meaning.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\+&lt;/tt&gt; matches &lt;tt class="match"&gt;+&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\xFF&lt;/tt&gt; where FF are 2 hexadecimal digits &lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches the character with the specified ASCII/ANSI value, which depends on the code page used. Can be used in character classes.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\xA9&lt;/tt&gt; matches &lt;tt class="match"&gt;©&lt;/tt&gt;&lt;/span&gt; when using the Latin-1 code page.&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\n&lt;/tt&gt;, &lt;tt&gt;\r&lt;/tt&gt; and &lt;tt&gt;\t&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Match an LF character, CR character and a tab character respectively. Can be used in character classes.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\r\n&lt;/tt&gt; matches a DOS/Windows CRLF line break.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(204, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Character Classes or Character Sets [abc]&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;[&lt;/tt&gt; (opening square bracket)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Starts a character class. A character class matches a single character out of all the possibilities offered by the character class. Inside a character class, different rules apply. The rules in this section are only valid inside character classes. The rules outside this section are not valid in character classes, except &lt;tt&gt;\n&lt;/tt&gt;, &lt;tt&gt;\r&lt;/tt&gt;, &lt;tt&gt;\t&lt;/tt&gt; and &lt;tt&gt;\xFF&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Any character except &lt;/span&gt;&lt;nobr&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;^-]\&lt;/tt&gt;&lt;/span&gt;&lt;/nobr&gt;&lt;span style="font-size:85%;"&gt; add that character to the possible matches for the character class.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;All characters except the listed special characters.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;[abc]&lt;/tt&gt; matches &lt;tt class="match"&gt;a&lt;/tt&gt;, &lt;tt class="match"&gt;b&lt;/tt&gt;&lt;tt class="match"&gt;c&lt;/tt&gt;&lt;/span&gt; or &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\&lt;/tt&gt; (backslash) followed by any of &lt;/span&gt;&lt;nobr&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;^-]\&lt;/tt&gt;&lt;/span&gt;&lt;/nobr&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;A backslash escapes special characters to suppress their special meaning.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;[\^\]]&lt;/tt&gt; matches &lt;tt class="match"&gt;^&lt;/tt&gt; or &lt;tt class="match"&gt;]&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;-&lt;/tt&gt; (hyphen) except immediately after the opening &lt;tt&gt;[&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Specifies a range of characters. (Specifies a hyphen if placed immediately after the opening &lt;tt&gt;[&lt;/tt&gt;)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;[a-zA-Z0-9]&lt;/tt&gt;&lt;/span&gt; matches any letter or digit&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;^&lt;/tt&gt; (caret) immediately after the opening &lt;tt&gt;[&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Negates the character class, causing it to match a single character &lt;i&gt;not&lt;/i&gt; listed in the character class. (Specifies a caret if placed anywhere except after the opening &lt;tt&gt;[&lt;/tt&gt;)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;[^a-d]&lt;/tt&gt; matches &lt;tt class="match"&gt;x&lt;/tt&gt;&lt;/span&gt; (any character except a, b, c or d)&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\d&lt;/tt&gt;, &lt;tt&gt;\w&lt;/tt&gt; and &lt;tt&gt;\s&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Shorthand character classes matching digits 0-9, word characters (letters and digits) and whitespace respectively. Can be used inside and outside character classes&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;[\d\s]&lt;/tt&gt; matches a character that is a digit or whitespace&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\D&lt;/tt&gt;, &lt;tt&gt;\W&lt;/tt&gt; and &lt;tt&gt;\S&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Negated versions of the above. Should be used only outside character classes. (Can be used inside, but that is confusing).)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\D&lt;/tt&gt; matches a character that is not a digit&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(153, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Dot&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;.&lt;/tt&gt; (dot)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches any single character except line break characters \r and \n. Most regex flavors have an option to make the dot match line break characters too.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;.&lt;/tt&gt; matches &lt;tt class="match"&gt;x&lt;/tt&gt; or (almost) any other character&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(153, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Anchors&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;^&lt;/tt&gt; (caret)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the start of the string the regex pattern is applied to. Matches a position rather than a character. Most regex flavors have an option to make the caret match after line breaks (i.e. at the start of a line in a file) as well.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;^.&lt;/tt&gt; matches &lt;tt class="match"&gt;a&lt;/tt&gt; in &lt;tt class="string"&gt;abc\ndef&lt;/tt&gt;. Also matches &lt;tt class="match"&gt;d&lt;/tt&gt; in "multi-line" mode.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;$&lt;/tt&gt; (dollar)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Most regex flavors have an option to make the dollar match before line breaks (i.e. at the end of a line in a file) as well. Also matches before the very last line break if the string ends with a line break.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;.$&lt;/tt&gt; matches &lt;tt class="match"&gt;f&lt;/tt&gt; in &lt;tt class="string"&gt;abc\ndef&lt;/tt&gt;. Also matches &lt;tt class="match"&gt;c&lt;/tt&gt; in "multi-line" mode.&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\A&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the start of the string the regex pattern is applied to. Matches a position rather than a character. Never matches after line breaks.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\A.&lt;/tt&gt; matches &lt;tt class="match"&gt;a&lt;/tt&gt; in &lt;tt class="string"&gt;abc&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\Z&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Never matches before line breaks, except for the very last line break if the string ends with a line break.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;.\Z&lt;/tt&gt; matches &lt;tt class="match"&gt;f&lt;/tt&gt; in &lt;tt class="string"&gt;abc\ndef&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\z&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the end of the string the regex pattern is applied to. Matches a position rather than a character. Never matches before line breaks.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;.\z&lt;/tt&gt; matches &lt;tt class="match"&gt;f&lt;/tt&gt; in &lt;tt class="string"&gt;abc\ndef&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(153, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Word Boundaries&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\b&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the position between a word character (anything matched by &lt;tt class="regex"&gt;\w&lt;/tt&gt;) and a non-word character (anything matched by &lt;tt class="regex"&gt;[^\w]&lt;/tt&gt;&lt;tt class="regex"&gt;\W&lt;/tt&gt;) as well as at the start and/or end of the string if the first and/or last characters in the string are word characters.&lt;/span&gt; or &lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;.\b&lt;/tt&gt; matches &lt;tt class="match"&gt;c&lt;/tt&gt; in &lt;tt class="string"&gt;abc&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;\B&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Matches at the position between two word characters (i.e the position between &lt;tt class="regex"&gt;\w\w&lt;/tt&gt;) as well as at the position between two non-word characters (i.e. &lt;tt class="regex"&gt;\W\W&lt;/tt&gt;).&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;\B.\B&lt;/tt&gt; matches &lt;tt class="match"&gt;b&lt;/tt&gt; in &lt;tt class="string"&gt;abc&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(153, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Alternation&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;|&lt;/tt&gt; (pipe)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Causes the regex engine to match either the part on the left side, or the part on the right side. Can be strung together into a series of options.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;abc|def|xyz&lt;/tt&gt;&lt;tt class="match"&gt;abc&lt;/tt&gt;, &lt;tt class="match"&gt;def&lt;/tt&gt; or &lt;tt class="match"&gt;xyz&lt;/tt&gt;&lt;/span&gt; matches &lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;|&lt;/tt&gt; (pipe)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;The pipe has the lowest precedence of all operators. Use grouping to alternate only part of the regular expression.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;abc(def|xyz)&lt;/tt&gt;&lt;tt class="match"&gt;abcdef&lt;/tt&gt; or &lt;tt class="match"&gt;abcxyz&lt;/tt&gt;&lt;/span&gt; matches &lt;/td&gt;&lt;/tr&gt; &lt;tr style="color: rgb(153, 0, 0);"&gt;&lt;th colspan="3"&gt;&lt;span style="font-size:85%;"&gt;Quantifiers&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Character&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;th style="color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:85%;"&gt;Example&lt;/span&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;?&lt;/tt&gt; (question mark)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Makes the preceding item optional. Greedy, so the optional item is included in the match if possible.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;abc?&lt;/tt&gt; matches &lt;tt class="match"&gt;ab&lt;/tt&gt; or &lt;tt class="match"&gt;abc&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;??&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Makes the preceding item optional. Lazy, so the optional item is excluded in the match if possible. This construct is often excluded from documentation because of its limited use.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;abc??&lt;/tt&gt; matches &lt;tt class="match"&gt;ab&lt;/tt&gt; or &lt;tt class="match"&gt;abc&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;*&lt;/tt&gt; (star)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item zero or more times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is not matched at all.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;".*"&lt;/tt&gt; matches &lt;tt class="match"&gt;"def" "ghi"&lt;/tt&gt; in &lt;tt class="string"&gt;abc "def" "ghi" jkl&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;*?&lt;/tt&gt; (lazy star)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item zero or more times. Lazy, so the engine first attempts to skip the previous item, before trying permutations with ever increasing matches of the preceding item.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;".*?"&lt;/tt&gt; matches &lt;tt class="match"&gt;"def"&lt;/tt&gt; in &lt;tt class="string"&gt;abc "def" "ghi" jkl&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;+&lt;/tt&gt; (plus)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item once or more. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is matched only once.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;".+"&lt;/tt&gt; matches &lt;tt class="match"&gt;"def" "ghi"&lt;/tt&gt; in &lt;tt class="string"&gt;abc "def" "ghi" jkl&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;+?&lt;/tt&gt; (lazy plus)&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item once or more. Lazy, so the engine first matches the previous item only once, before trying permutations with ever increasing matches of the preceding item.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;".+?"&lt;/tt&gt; matches &lt;tt class="match"&gt;"def"&lt;/tt&gt; in &lt;tt class="string"&gt;abc "def" "ghi" jkl&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;{n}&lt;/tt&gt; where n is an integer &gt;= 1&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item exactly n times.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a{3}&lt;/tt&gt; matches &lt;tt class="match"&gt;aaa&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;{n,m}&lt;/tt&gt; where n &gt;= 1 and m &amp;gt;= n&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item between n and m times. Greedy, so repeating m times is tried before reducing the repetition to n times.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a{2,4}&lt;/tt&gt; matches &lt;tt class="match"&gt;aa&lt;/tt&gt;, &lt;tt class="match"&gt;aaa&lt;/tt&gt; or &lt;tt class="match"&gt;aaaa&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;{n,m}?&lt;/tt&gt; where n &gt;= 1 and m &gt;= n&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item between n and m times. Lazy, so repeating n times is tried before increasing the repetition to m times.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a{2,4}?&lt;/tt&gt; matches &lt;tt class="match"&gt;aaaa&lt;/tt&gt;, &lt;tt class="match"&gt;aaa&lt;/tt&gt; or &lt;tt class="match"&gt;aa&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;{n,}&lt;/tt&gt; where n &gt;= 1&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item at least n times. Greedy, so as many items as possible will be matched before trying permutations with less matches of the preceding item, up to the point where the preceding item is matched only n times.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a{2,}&lt;/tt&gt; matches &lt;tt class="match"&gt;aaaaa&lt;/tt&gt; in &lt;tt class="string"&gt;aaaaa&lt;/tt&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt&gt;{n,}?&lt;/tt&gt; where n &gt;= 1&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;Repeats the previous item between n and m times. Lazy, so the engine first matches the previous item n times, before trying permutations with ever increasing matches of the preceding item.&lt;/span&gt;&lt;/td&gt; &lt;td valign="top"&gt;&lt;span style="font-size:85%;"&gt;&lt;tt class="regex"&gt;a{2,}?&lt;/tt&gt; matches &lt;tt class="match"&gt;aa&lt;/tt&gt;&lt;tt class="string"&gt;aaaaa&lt;/tt&gt;&lt;/span&gt; in &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p&gt;Reproduced from &lt;a href="http://www.regular-expressions.info/reference.html"&gt;http://www.regular-expressions.info/reference.html&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115133094054047461?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115133094054047461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/06/regular-expression-syntax-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115133094054047461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115133094054047461'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/06/regular-expression-syntax-reference.html' title='Regular Expression Syntax Reference'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30284608.post-115132967182454585</id><published>2006-06-26T06:41:00.000-07:00</published><updated>2006-09-03T05:45:25.526-07:00</updated><title type='text'>Table of Contents</title><content type='html'>&lt;span style="font-size:85%;"&gt;This blog contains some of the most useful programming reference I ever use in my work as a software engineer. I will be posting more of these quick references in the near future.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;Project Management &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/common-project-management-pitfalls.html"&gt;&lt;span style="font-size:85%;"&gt;Project Management Pitfalls Part 1:   Project Objectives not fully specified / Communication errors&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;C# Rich Client&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/06/regular-expression-syntax-reference.html"&gt;    Regular Expressions Quick Reference&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/06/regular-expression-testing-tools.html"&gt;Regular Expressions Testing Tools&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/how-to-enter-symbols-into-window-forms_14.html"&gt;Entering symbols into textbox in Rich Client&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;ASP.NET &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/06/downloading-files.html"&gt;Downloading Documents Online&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/06/asp-net-11-upload-files.html"&gt;Uploading Documents Online&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/how-to-enter-symbols-into-window-forms_14.html"&gt;Entering symbols into textbox in ASP.NET&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/09/how-to-send-email-using-c.html"&gt;How to send Email&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 0);"&gt;DataBase &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/connection-strings.html"&gt;&lt;span style="font-size:85%;"&gt;DataBase Connection Strings&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/how-do-i-enter-null-date-into-database.html"&gt;How to Enter a null Date into Database&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/how-to-store-database-connection-in.html"&gt;Entering Database ConnectionStrings into Web Config Files&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;EJB/JSP&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/sun-java-ide.html"&gt;&lt;span style="font-size:85%;"&gt;Sun Java IDE for EJB / JSP&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;&lt;a href="http://programminggems.blogspot.com/2006/07/sun-java-ide.html"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30284608-115132967182454585?l=programminggems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programminggems.blogspot.com/feeds/115132967182454585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programminggems.blogspot.com/2006/06/table-of-contents.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115132967182454585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30284608/posts/default/115132967182454585'/><link rel='alternate' type='text/html' href='http://programminggems.blogspot.com/2006/06/table-of-contents.html' title='Table of Contents'/><author><name>Eugene Lim</name><uri>https://profiles.google.com/100323426627625888430</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh6.googleusercontent.com/-eUONMlWVb7g/AAAAAAAAAAI/AAAAAAAAAAA/g6Rs1wO7JOw/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
