<?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-7572066927231765326</id><updated>2011-07-08T10:20:45.498-05:00</updated><category term='IMAP'/><category term='AJAX'/><category term='XML'/><category term='sqldatasource'/><category term='dropdownlist'/><category term='SQL'/><category term='UpdatePanel'/><category term='TabContainer'/><category term='RequiredFieldValidator'/><category term='PageRequestManagerParserErrorException'/><category term='Telnet'/><title type='text'>Last Resort for Coding Solutions</title><subtitle type='html'>Solution I have found that made my errors go away!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-8732177759152596019</id><published>2009-08-27T09:02:00.006-05:00</published><updated>2009-08-27T09:13:52.288-05:00</updated><title type='text'>How to delete duplicate records in sql database</title><content type='html'>It took me deleting ALL the records from my database before I figured out how to do this!  :(  My solution to the problem of duplicate records in the database relies on the fact that there is at least ONE column that has duplicate information.  In my case I only had two records where there should have been one.  So the code I used to remove one of the two duplicated records is as follows:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;DELETE A&lt;br /&gt;  FROM [emailsTable] A, [emailTable] B&lt;br /&gt;  WHERE A.MessageID = B.MessageID&lt;div&gt;    AND A.GUID &gt; B.GUID&lt;/div&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-8732177759152596019?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/8732177759152596019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/08/how-to-delete-duplicate-records-in-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/8732177759152596019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/8732177759152596019'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/08/how-to-delete-duplicate-records-in-sql.html' title='How to delete duplicate records in sql database'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-4606376756139872857</id><published>2009-08-14T13:53:00.004-05:00</published><updated>2009-08-14T14:01:53.486-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Telnet'/><category scheme='http://www.blogger.com/atom/ns#' term='IMAP'/><title type='text'>IMAP is the devil</title><content type='html'>I spent the morning trying to figure out how to use IMAP.  I want to write my own little asp.net function that just marks all e-mails in an inbox as read and couldn't believe how difficult it was to find this information.  I finally stumbled upon bobpeers.com who's site had many GREAT examples of how to execute IMAP command via telnet.  With the help of this example and the IMAP4rev1 paper I was able to accomplish what I needed.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bobpeers.com/technical/telnet_imap.php" target="_blank"&gt;&amp;lt;bobpeers.com /&amp;gt; posting&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://james.apache.org/server/rfclist/imap4/rfc2060.txt" target="_blank"&gt;IMAP4rev1 paper&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-4606376756139872857?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/4606376756139872857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/08/imap-is-devil.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/4606376756139872857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/4606376756139872857'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/08/imap-is-devil.html' title='IMAP is the devil'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-187479170907376179</id><published>2009-05-14T15:55:00.008-05:00</published><updated>2009-06-01T13:26:24.090-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Mapping XML to SQL Tables</title><content type='html'>I was recently given an file that had over 14,000 lines of XML and was asked to get that XML data into three separate SQL Tables.  After a little bit of googling I found this website - which give lots of great examples of how to map an XML file to a sql table.&lt;br /&gt;&lt;br /&gt;&lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa225754(SQL.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa225754(SQL.80).aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One of the features I'd like to highlight is KeepIdentity.  This allows you to insert into a table that has Identity Specification set to Yes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-187479170907376179?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/187479170907376179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/mapping-xml-to-sql-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/187479170907376179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/187479170907376179'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/mapping-xml-to-sql-tables.html' title='Mapping XML to SQL Tables'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-3070566582719624724</id><published>2009-05-06T10:40:00.007-05:00</published><updated>2009-05-06T10:56:10.049-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sqldatasource'/><category scheme='http://www.blogger.com/atom/ns#' term='dropdownlist'/><title type='text'>Bind DropDownList with SqlDataSource and Custom ListItems</title><content type='html'>I ran into a small problem earlier today and wanted to make a note of it here in case I forget in the future.  I have a dropdownlist that contained a list of about 30 locations.  I originally hard coded these locations, but found later on that putting them in a sql table would be a good idea.  After I did that I set up the dropdownlist to use the table I just created:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:DropDownList ID="ddlUSERFacilityID" runat="server" AutoPostBack="true" &lt;span style="color:red"&gt; DataSourceID="dsFacilities" DataTextField="FacilityName" DataValueField="FacilityID"&lt;/span&gt; &amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;However I needed to add a "- Select One -" for the users that had either old and invalid facility ids or users who just didn't have one at all and I was stumped.  Clicking around a google search landed me this dropdownlist property that solved my problem:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color:red"&gt;AppendDataBoundItems="true"&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So the final control ended up looking like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;asp:DropDownList ID="ddlUSERFacilityID" runat="server" onChange="chgColor();" OnSelectedIndexChanged="updateStatus" AutoPostBack="true" DataSourceID="dsFacilities" DataTextField="FacilityName" DataValueField="FacilityID" AppendDataBoundItems="true"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ListItem Value="SelectOne" Selected="True"&amp;gt;- Select One -" &amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/asp:DropDownList&amp;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/7572066927231765326-3070566582719624724?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/3070566582719624724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/bind-dropdownlist-with-sqldatasource.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/3070566582719624724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/3070566582719624724'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/bind-dropdownlist-with-sqldatasource.html' title='Bind DropDownList with SqlDataSource and Custom ListItems'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-642862495349370754</id><published>2009-05-01T09:21:00.007-05:00</published><updated>2009-05-01T10:00:04.437-05:00</updated><title type='text'>Convert HEX color to System.Drawing color</title><content type='html'>I am working on a data grid at the moment - and one of the requirements of the grid was to have a clickable image as the remove button AND to have the whole row change colors when the image was clicked.  In my googling I came across this method:&lt;br /&gt;&lt;br /&gt;&lt;pre class="shBrushVb.js"&gt;&lt;br /&gt;Protected Sub btnRemove_Click(ByVal sender As System.Object, ByVal e As DataGridCommandEventArgs)&lt;br/&gt;&lt;br /&gt;e.Item.BackColor = System.Drawing.ColorTranslator.FromHtml("#ADD6FF")&lt;br/&gt;&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I added this to the codebehind for the click event and viola it works perfectly!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-642862495349370754?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/642862495349370754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/convert-hex-color-to-systemdrawing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/642862495349370754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/642862495349370754'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/05/convert-hex-color-to-systemdrawing.html' title='Convert HEX color to System.Drawing color'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-7195798664155856081</id><published>2009-04-27T11:02:00.004-05:00</published><updated>2009-04-27T11:05:41.998-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UpdatePanel'/><title type='text'>Setting TextBox Focus when using UpdatePanels</title><content type='html'>Try as I might TextBox1.Focus() would not give TextBox1 focus after an AsyncPostBack.  Placing a breakpoint on that particular like of code showed that the code was executing, but alas... no blinking cursor.  The solution to this problem is to use the ScriptManagers Focus()!  ScriptManager1.SetFocus(TextBox1) gave me the results I was looking for.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-7195798664155856081?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/7195798664155856081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/04/setting-textbox-focus-when-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/7195798664155856081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/7195798664155856081'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/04/setting-textbox-focus-when-using.html' title='Setting TextBox Focus when using UpdatePanels'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-9008054034891925132</id><published>2009-04-15T13:35:00.000-05:00</published><updated>2009-04-15T13:45:59.683-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PageRequestManagerParserErrorException'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><title type='text'>Ways to fix PageRequestManagerParserErrorException</title><content type='html'>I created a web app that retrieves data from a binary column in sql server.  In order to convert the data in that column I created an HttpHandler, but I had to pass an ID to the HttpHandler to pull the right row from the database.  I decided to pass the ID via the session, but once I added the code for the Session variable I started getting this weird error the very first time I would run my app: "Sys.WebForms.PageRequestManagerParserErrorException:  The message received from the server could not be parsed.  comonn causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled."  &lt;br /&gt;&lt;br /&gt;I did a lot of looking around on the interwebs and found two sites that eventually landed me a solution I was happy with.  This first &lt;a href="http://weblogs.asp.net/albertpascual/archive/2008/04/22/how-to-fix-sys-webforms-pagerequestmanagerparsererrorexception-in-ajax-1-0.aspx"&gt;blog&lt;/a&gt; suggested adding EnableEventValidation="False" to the top of the .aspx page, which did stop my error, but I wasn't comforatable doing this.  I did some searching through the comments of this second &lt;a href="http://alpascual.com/blog/how-to-fix-sys-webforms-pagerequestmanagerparsererrorexception-in-ajax/"&gt;blog&lt;/a&gt; and found out that all I needed to do was "initialize" my session variable, and that ended up working really well for me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-9008054034891925132?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/9008054034891925132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/04/ways-to-fix-pagerequestmanagerparsererr.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/9008054034891925132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/9008054034891925132'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/04/ways-to-fix-pagerequestmanagerparsererr.html' title='Ways to fix PageRequestManagerParserErrorException'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7572066927231765326.post-7122111428117542615</id><published>2009-03-27T09:05:00.000-05:00</published><updated>2009-03-27T09:15:23.834-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='RequiredFieldValidator'/><category scheme='http://www.blogger.com/atom/ns#' term='TabContainer'/><title type='text'>RequiredFieldValidator + AJAX TabContainer = mild frustration</title><content type='html'>I ran into a bit of trouble yesterday, but was finally able to decipher the problem and get my app working right today.  Here's my set up: I have a page with an AJAX TabContainer (it has two tabs).  On one tab there is a TextBox, a Button and a RequiredFieldValidator.  The problems began when I added a TexBox and Button to Tab 2.  When I click the button on Tab 2 the button_click event wouldn't fire, wouldn't fire, wouldn't fire.  I was at a loss.  So after systematically removing controls from each tab - I was able to narrow the issue down to the RequiredFieldValidator on Tab 1.  So I googled "ajax tabcontainer required field validator" and found &lt;a target="_blank" href="http://forums.asp.net/p/1115603/1728279.aspx"&gt;this&lt;/a&gt; post that really helped a lot and actually ended up making perfect sense.  Add a ValidationGroup!  Makes PERFECT SENSE!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7572066927231765326-7122111428117542615?l=lastresortcode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lastresortcode.blogspot.com/feeds/7122111428117542615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://lastresortcode.blogspot.com/2009/03/requiredfieldvalidator-ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/7122111428117542615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7572066927231765326/posts/default/7122111428117542615'/><link rel='alternate' type='text/html' href='http://lastresortcode.blogspot.com/2009/03/requiredfieldvalidator-ajax.html' title='RequiredFieldValidator + AJAX TabContainer = mild frustration'/><author><name>swolff1978</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_02khCuiJ4rw/SB_HN0Aj6OI/AAAAAAAAACg/YE_CocaHIuQ/S220/Black-In-White-Big.jpg'/></author><thr:total>0</thr:total></entry></feed>
