<?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-3467743484223235841</id><updated>2012-02-17T12:35:09.739-08:00</updated><title type='text'>Computer stuff you might find useful...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-2071268825105069195</id><published>2012-02-17T12:35:00.000-08:00</published><updated>2012-02-17T12:35:09.750-08:00</updated><title type='text'>using SqlDataSource in code</title><content type='html'>Sometimes there is a need to use a SqlDataSource object in the code...&lt;br /&gt;&lt;br /&gt;ASPX:&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;asp:SqlDataSource ID="sqlSelectUsers" runat="server"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ConnectionString="&amp;lt;%$ConnectionStrings:MainConnectionString %&amp;gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ProviderName="&amp;lt;%$ ConnectionStrings:MainConnectionString.ProviderName %&amp;gt;"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SelectCommandType="StoredProcedure"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SelectCommand="spSelectUsers"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;SelectParameters&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&amp;lt;asp:Parameter Name="RequestingUserID" Type="Int16" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;/SelectParameters&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;/asp:SqlDataSource&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;VB:&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;sqlSelectUsers.SelectParameters("RequestingUserID").DefaultValue = 2&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;//hard coded value for demo purposes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Dim dv As DataView = sqlSelectUsers.Select(DataSourceSelectArguments.Empty)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Dim dt As DataTable = dv.ToTable()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will result in a DataTable for manual consumption.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-2071268825105069195?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/2071268825105069195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/using-sqldatasource-in-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2071268825105069195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2071268825105069195'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/using-sqldatasource-in-code.html' title='using SqlDataSource in code'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-5963795912970965945</id><published>2012-02-17T10:29:00.001-08:00</published><updated>2012-02-17T10:29:52.732-08:00</updated><title type='text'>Another way to parse CSV parameters for values not necessarily in a table</title><content type='html'>-- &lt;a href="http://www.projectdmx.com/tsql/tblnumbers.aspx"&gt;http://www.projectdmx.com/tsql/tblnumbers.aspx&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;CREATE TABLE dbo.Nbrs(n INT NOT NULL IDENTITY) ;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;INSERT dbo.Nbrs DEFAULT VALUES ;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;WHILE SCOPE_IDENTITY() &amp;lt; 500 INSERT dbo.Nbrs DEFAULT VALUES ;&lt;br /&gt;&lt;br /&gt;-- &lt;a href="http://www.projectdmx.com/tsql/sqlarrays.aspx"&gt;http://www.projectdmx.com/tsql/sqlarrays.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DECLARE @p VARCHAR(50)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SET @p = 'ALFKI,LILAS,PERIC,HUNGC,SAVEA,SPLIR,LONEP,GROSR'&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SELECT SUBSTRING( ',' + @p + ',', n + 1, CHARINDEX( ',', ',' + @p + ',', n + 1 ) - n - 1 ) AS "value"&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;FROM Nbrs&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;WHERE SUBSTRING( ',' + @p + ',', n, 1 ) = ',' AND n &amp;lt; LEN( ',' + @p + ',' ) ;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;drop table Nbrs &amp;nbsp; &amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-5963795912970965945?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/5963795912970965945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/another-way-to-parse-csv-parameters-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/5963795912970965945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/5963795912970965945'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/another-way-to-parse-csv-parameters-for.html' title='Another way to parse CSV parameters for values not necessarily in a table'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-2951937012581084116</id><published>2012-02-16T12:25:00.000-08:00</published><updated>2012-02-16T12:26:10.095-08:00</updated><title type='text'>Convert a SQL CSV Parameter into a table</title><content type='html'>Consider the need to pass in a CSV parameter like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;DECLARE @UserIDs_CSV VARCHAR(50)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SET @UserIDs_CSV = '1,2,4,5,8,9'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If that CSV parameter happens to correlate to a table, like in this case, Users... Use a query like this to convert the CSV parameter into a temp table...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT UserID&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;into #SelectedUserIDs&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;FROM Users&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;WHERE CHARINDEX(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;',' + cast(UserID as varchar(10)) + ',',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;',' + @UserIDs_CSV + ','&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;) &amp;gt; 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So now just use the temp table as you need for future queries...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;select * from #SelectedUserIDs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Credit goes to &lt;a href="http://www.projectdmx.com/tsql/sqlarrays.aspx"&gt;http://www.projectdmx.com/tsql/sqlarrays.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-2951937012581084116?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/2951937012581084116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/convert-sql-csv-parameter-into-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2951937012581084116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2951937012581084116'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/convert-sql-csv-parameter-into-table.html' title='Convert a SQL CSV Parameter into a table'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-2802189227765857669</id><published>2012-02-06T11:29:00.000-08:00</published><updated>2012-02-06T11:29:10.675-08:00</updated><title type='text'>Getting a quicker SQL row count</title><content type='html'>Credit goes to Rick Caminiti at&amp;nbsp;&lt;a href="http://rickcaminiti.com/tips/alternative-efficient-tables-rowcount-sql/"&gt;http://rickcaminiti.com/tips/alternative-efficient-tables-rowcount-sql/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: white; color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;SELECT COUNT(*) statements make a full table scans to return the total table’s row count, it can take a lot of time and a lot of “energy” for a large table.&lt;/div&gt;&lt;div style="background-color: white; color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;There is another way to determine the total row count in a table by using the sysindexes system table. There is a column (ROWS) in it that contains the total row count for each table in your database.&lt;/div&gt;&lt;div style="background-color: white; color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;You can use the syntax below to speed up the query by several times.&amp;nbsp; You can see this by setting statistics on, as shown below.&lt;/div&gt;&lt;div style="background-color: white; color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;/div&gt;&lt;div style="background-color: white; color: #555555; font-family: Verdana, 'BitStream vera Sans', Tahoma, Helvetica, sans-serif; font-size: 12px; line-height: 17px; margin-bottom: 10px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;code style="background-color: white; color: #555555; font-size: 12px; line-height: 17px;"&gt;&lt;div class="MsoNormal" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;STATISTICS&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;IO&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;ON&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&lt;span style="color: magenta;"&gt;count&lt;/span&gt;&lt;span style="color: grey;"&gt;(*)&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&amp;nbsp;tbTest&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SELECT&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;rows&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;FROM&lt;/span&gt;&amp;nbsp;sysindexes&amp;nbsp;&lt;span style="color: blue;"&gt;WHERE&lt;/span&gt;&amp;nbsp;id&amp;nbsp;&lt;span style="color: grey;"&gt;=&lt;/span&gt;&amp;nbsp;&lt;span style="color: magenta;"&gt;OBJECT_ID&lt;/span&gt;&lt;span style="color: grey;"&gt;(&lt;/span&gt;&lt;span style="color: red;"&gt;'tbTest'&lt;/span&gt;&lt;span style="color: grey;"&gt;)&lt;/span&gt;&amp;nbsp;&lt;span style="color: grey;"&gt;AND&lt;/span&gt;&amp;nbsp;indid&amp;nbsp;&lt;span style="color: grey;"&gt;&amp;lt;&lt;/span&gt;&amp;nbsp;2&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="margin-bottom: 0pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;span style="color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;SET&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;STATISTICS&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;IO&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue;"&gt;OFF&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New'; font-size: 10pt;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I tried my own test, and here are my results:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;Table 'myTable'. Scan count 1, logical reads 116, physical reads 1, read-ahead reads 176, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.&lt;br /&gt;&lt;br /&gt;(1 row(s) affected)&lt;br /&gt;Table 'sysidxstats'. Scan count 1, logical reads 5, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-2802189227765857669?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/2802189227765857669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/getting-quicker-sql-row-count.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2802189227765857669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2802189227765857669'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2012/02/getting-quicker-sql-row-count.html' title='Getting a quicker SQL row count'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-1568720233537337979</id><published>2011-12-21T09:52:00.000-08:00</published><updated>2011-12-21T09:52:03.105-08:00</updated><title type='text'>Reset Windows Media Player 12 To Default Settings</title><content type='html'>&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Here's a cool trick that allows you to reset WMP12 back to it’s default settings. This might be handy if you are encountering any issues of your own.&lt;/div&gt;&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Simply to go Start &amp;gt; Run (or hold down the Windows Key and press R) and type in the following:&lt;/div&gt;&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 0px; margin-left: auto; margin-right: auto; margin-top: 0px; padding-bottom: 7px; padding-left: 7px; padding-right: 7px; padding-top: 7px; text-align: center;"&gt;&lt;/div&gt;&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;strong style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;msdt.exe -id WindowsMediaPlayerConfigurationDiagnostic&lt;/strong&gt;&lt;/div&gt;&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Press enter and follow the prompts to reset WMP.&lt;/div&gt;&lt;div style="background-color: #f5f4f4; color: #6f5e4e; font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; margin-bottom: 1em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;Credit goes to Ben: &amp;nbsp;&lt;a href="http://daily-grind.net/reset-windows-media-player-12-to-default-settings/" style="background-color: transparent;"&gt;http://daily-grind.net/reset-windows-media-player-12-to-default-settings/&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-1568720233537337979?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/1568720233537337979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/12/reset-windows-media-player-12-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/1568720233537337979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/1568720233537337979'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/12/reset-windows-media-player-12-to.html' title='Reset Windows Media Player 12 To Default Settings'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-1644634150546928421</id><published>2011-12-08T09:00:00.000-08:00</published><updated>2011-12-08T09:00:56.405-08:00</updated><title type='text'>SQL example for updating children records from a parent record</title><content type='html'>I just ran into this again, and I know I have had to do this several times before but it gets old having to look up such an activity that I may only do twice a year.&lt;br /&gt;&lt;br /&gt;The scenario... There are four records:&lt;br /&gt;ID=123, ParentID=null, Name="Bob"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ID=1000, ParentID=123, Name="Bob"&lt;br /&gt;ID=1001, ParentID=123, Name="Bob"&lt;br /&gt;ID=1002, ParentID=123, Name="Bob"&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The requirement is to update Name="Joe" where ID=123, and then cascade the changes to the children records. &amp;nbsp;This could be done easily w/ the same proc that updates the parent, however in my situation that proc is being shared, so my solution is to make a new query that fetches the right info w/ a join and then updates:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;UPDATE children&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SET&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;Field1 = parent.Field1,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;Field2 = parent.Field2,&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;Field3 = parent.Field3&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;from ExampleTable children&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;inner join ExampleTable parent on parent.ID = children.ParentID&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;WHERE children.ParentID = @ParentID&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-1644634150546928421?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/1644634150546928421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/12/sql-example-for-updating-children.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/1644634150546928421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/1644634150546928421'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/12/sql-example-for-updating-children.html' title='SQL example for updating children records from a parent record'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-2337446338721276016</id><published>2011-10-03T12:27:00.000-07:00</published><updated>2011-10-03T12:27:26.070-07:00</updated><title type='text'>Clear the "must change password" checkbox for new SQL users.</title><content type='html'>It's very annoying to create a new SQL user and forget to clear the "User must change password at next login" checkbox.&lt;br /&gt;&lt;br /&gt;This will result in an error message:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Login failed for user 'login_name'. &amp;nbsp;Reason: The password of the account must be changed.&lt;br /&gt;&lt;br /&gt;If you try to clear the message, you get:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;The CHECK_POLICY and CHECK_EXPIRATION options cannot be turned OFF when MUST_CHANGE is ON. (Microsoft SQL Server, Error: 15128)&lt;br /&gt;&lt;br /&gt;One solution is to delete the user and create again, and clear the checkbox. &amp;nbsp;Another solution I found on Experts Exchange:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ALTER LOGIN UserLogin WITH PASSWORD = 'NewPassword' UNLOCK&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;Then you can uncheck 'Enforce password policy' and 'Enforce password expiration' or just run the following two sql commands:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ALTER LOGIN UserLogin WITH CHECK_EXPIRATION = OFF&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ALTER LOGIN UserLogin WITH CHECK_POLICY = OFF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_23063893.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-2337446338721276016?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/2337446338721276016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/10/clear-must-change-password-checkbox-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2337446338721276016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/2337446338721276016'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/10/clear-must-change-password-checkbox-for.html' title='Clear the &quot;must change password&quot; checkbox for new SQL users.'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-8430783863896882265</id><published>2011-09-12T09:44:00.000-07:00</published><updated>2011-09-12T09:58:05.261-07:00</updated><title type='text'>Word 2007 document with comments is crashing</title><content type='html'>My coworker had a document that had around 30 comments and when she'd click on the comment to delete it, Word 2007 would crash. &amp;nbsp;She mentioned that the comment targets somehow were erased and the comments were orphaned but still in the document.&lt;br /&gt;&lt;br /&gt;Word has a recovery mode that did not work. &amp;nbsp;I tried copy/pasting to a new document which did not work. &amp;nbsp;Even tried using a VBA macro to delete a comment, then altered it to select and delete these other comments. &amp;nbsp;That didn't work either.&lt;br /&gt;&lt;br /&gt;I know Word 2007 uses the new .docx format, which is really just a zip file container. &amp;nbsp;So I unzipped the .docx file, dug around in the supporting XML files, and found two files. &amp;nbsp;There is a document.xml and a comments.xml and inside the comments.xml file is an ID in each node that the document.xml file references. &amp;nbsp;Pretty simple layout.&lt;br /&gt;&lt;br /&gt;In the document.xml file, I searched for "w:comment" and found hits on nodes named&lt;br /&gt;&amp;lt;w:commentRangeStart w:id="3" /&amp;gt;&lt;br /&gt;&amp;lt;w:commentRangeEnd w:id="3"/&amp;gt;&lt;br /&gt;&amp;lt;w:commentReference w:id="3"/&amp;gt;&lt;br /&gt;&lt;br /&gt;Those nodes match the comments.xml document that has&lt;br /&gt;&amp;lt;w:comment w:id="3"&amp;gt;&lt;br /&gt;&lt;br /&gt;Furthermore, while searching through the document.xml file, the IDs for problematic comments just happened to have&lt;br /&gt;&lt;br /&gt;&amp;lt;w:commentReference w:id="3"/&amp;gt;&lt;br /&gt;but not&lt;br /&gt;&lt;br /&gt;&amp;lt;w:commentRangeStart w:id="3" /&amp;gt;&lt;br /&gt;&amp;lt;w:commentRangeEnd w:id="3"/&amp;gt;&lt;br /&gt;&lt;br /&gt;So... Remove the broken references in document.xml and now there are fully orphaned items in comments.xml so remove those nodes as well. &amp;nbsp;Save all docs, then rezip the folder and rename to .docx&lt;br /&gt;&lt;br /&gt;The doc opens fine, and Word 2007 no longer crashes :) &amp;nbsp;Woohoo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-8430783863896882265?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/8430783863896882265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/09/word-2007-document-with-comments-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8430783863896882265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8430783863896882265'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/09/word-2007-document-with-comments-is.html' title='Word 2007 document with comments is crashing'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-754582707967717571</id><published>2011-09-01T07:58:00.000-07:00</published><updated>2011-09-01T07:58:25.246-07:00</updated><title type='text'>Ensure deploys are not in debug mode</title><content type='html'>&lt;br /&gt;&lt;div class="MsoNormal"&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/04/11/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/04/11/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;b&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;The &amp;lt;deployment retail=”true”/&amp;gt; Switch in Machine.config&lt;/span&gt;&lt;/b&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;If you are a server administrator and want to ensure that no one accidentally deploys an ASP.NET application in production with the &amp;lt;compilation debug=”true”/&amp;gt; switch enabled within the application’s web.config file, one trick you can use with ASP.NET V2.0 is to take advantage of the &amp;lt;deployment&amp;gt; section within your machine.config file.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;Specifically, by setting this within your machine.config file:&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;&amp;lt;configuration&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;deployment retail=”true”/&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;&amp;lt;/configuration&amp;gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;You will disable the &amp;lt;compilation debug=”true”/&amp;gt; switch, disable the ability to output trace output in a page, and turn off the ability to show detailed error messages remotely.&amp;nbsp;&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;Note that these last two items are security best practices you really want to follow (otherwise hackers can learn a lot more about the internals of your application than you should show them).&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="MsoNormal"&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;Setting this switch to true is probably a best practice that any company with formal production servers should follow to ensure that an application always runs with the best possible performance and no security information leakages.&amp;nbsp;&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;There isn’t a ton of documentation on this switch – but you can learn a little more about it&lt;span class="apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;a href="http://msdn2.microsoft.com/en-US/library/ms228298(VS.80).aspx"&gt;&lt;span style="color: #3399ff; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt;"&gt;.&lt;/span&gt;&lt;span style="color: black;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-754582707967717571?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/754582707967717571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/09/ensure-deploys-are-not-in-debug-mode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/754582707967717571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/754582707967717571'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/09/ensure-deploys-are-not-in-debug-mode.html' title='Ensure deploys are not in debug mode'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-6719516922452146259</id><published>2011-08-30T19:32:00.000-07:00</published><updated>2011-08-30T19:32:12.782-07:00</updated><title type='text'>WebResource.axd returns 404 and then starts working after a while on it's own</title><content type='html'>&lt;br /&gt;Original question that I posted:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://stackoverflow.com/questions/6902650/webresource-axd-wont-update"&gt;http://stackoverflow.com/questions/6902650/webresource-axd-wont-update&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://forums.asp.net/t/1711550.aspx/1?WebResource+axd+returns+404+and+then+starts+working+after+a+while+on+it+s+own"&gt;http://forums.asp.net/t/1711550.aspx/1?WebResource+axd+returns+404+and+then+starts+working+after+a+while+on+it+s+own&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;We have a library of common controls, and I'm attempting to steer towards using embedded resources in it for images, JS, and CSS. It seems that upon each deploy to TEST/PROD, there is a window of time where WebResource.axd is returning a 404. After that window of time expires, suddenly the page starts serving out content properly. On my local DEV machine it seems that there are times when I can compile and reload a page that is using embedded resources, and it immediately shows a difference. Other times it responds like there is a cache waiting to expire.&lt;br /&gt;Things I've tried:&lt;br /&gt;- browsing from different machines to rule out local caching&lt;br /&gt;- iisreset&lt;br /&gt;- net stop w3svc&lt;br /&gt;- delete temp files from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files and C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files&lt;br /&gt;- killing the inetinfo.exe process&lt;br /&gt;- killing the w3wp.exe process&lt;br /&gt;- disabling IIS Output Caching&lt;br /&gt;- copying the URL and adding in an extra false querystring parameter to mimic a new page request&lt;br /&gt;- pressing Ctrl-F5 :)&lt;br /&gt;It seems rebooting fixes the issue.&lt;br /&gt;My google kung-fu has diluted results filled with everyone's answer to check the namespace. I am confident the namespace is correct. After a while the resource will start serving out properly and the correct version. And if it DOES serve at some point, it seems logical to me that the namespace must be correct.&lt;br /&gt;Any ideas? What other information can I provide?&lt;br /&gt;Thanks,&lt;br /&gt;James&lt;br /&gt;Michigan, USA&lt;/blockquote&gt;OK, WOW... FINALLY stumbled a solution. &amp;nbsp;Ready? This is going to be a long one :)&lt;br /&gt;&lt;br /&gt;While trying to get more information, I load Fiddler and I'm looking at the headers... when I come across&lt;br /&gt;this standard .NET error (edited):&lt;br /&gt;&lt;blockquote&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;head&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;The resource cannot be found.&amp;lt;/title&amp;gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;	&lt;/span&gt;[snip]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/head&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;body bgcolor="white"&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;span&amp;gt;&amp;lt;H1&amp;gt;Server Error in '/' Application.&amp;lt;hr width=100% size=1 color=silver&amp;gt;&amp;lt;/H1&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;h2&amp;gt; &amp;lt;i&amp;gt;The resource cannot be found.&amp;lt;/i&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;		&lt;/span&gt;[snip]&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;b&amp;gt;Version Information:&amp;lt;/b&amp;gt;&amp;amp;nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/font&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;!--&lt;br /&gt;[HttpException]: This is an invalid webresource request.&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()&lt;br /&gt;&amp;nbsp; &amp;nbsp;at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp;amp; completedSynchronously)&lt;br /&gt;--&amp;gt;&lt;/span&gt;&amp;lt;!--&lt;br /&gt;This error page might contain sensitive information because ASP.NET is configured to show verbose error messages&lt;br /&gt;using &amp;amp;lt;customErrors mode="Off"/&amp;amp;gt;. Consider using &amp;amp;lt;customErrors mode="On"/&amp;amp;gt; or &amp;amp;lt;customErrors&lt;br /&gt;mode="RemoteOnly"/&amp;amp;gt; in production environments.--&amp;gt;&lt;/blockquote&gt;WHOA... there's a commented stack trace that is buried in the page?!?! &amp;nbsp;After a quick Google search and I come across a link to&amp;nbsp;&lt;a href="http://stackoverflow.com/questions/1096793/system-web-httpexception-this-is-an-invalid-script-resource-request"&gt;http://stackoverflow.com/questions/1096793/system-web-httpexception-this-is-an-invalid-script-resource-request&lt;/a&gt;&amp;nbsp;and on that page I stumble across this comment by Rob Levine (&lt;a href="http://stackoverflow.com/users/134754/rob-levine"&gt;http://stackoverflow.com/users/134754/rob-levine&lt;/a&gt;):&lt;br /&gt;&lt;blockquote&gt;Believe it or not, if your dlls have embedded resources in them, and they are dated in the future this will happen&amp;nbsp;(if you ever compile dlls in the UK and then immediately deploy them to US web servers you'll be well aware of this issue!).&amp;nbsp;I can't remember the event log error this shows, but would know if I saw it - and it is not immediately obvious.&lt;/blockquote&gt;That is exactly the situation... I compile in Eastern Time, then deploy to Rackspace in Central Time. &amp;nbsp;After about an hour&amp;nbsp;the resources begin to load again... it makes sense... the time stamps catch up!&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-6719516922452146259?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/6719516922452146259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/08/webresourceaxd-returns-404-and-then.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/6719516922452146259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/6719516922452146259'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/08/webresourceaxd-returns-404-and-then.html' title='WebResource.axd returns 404 and then starts working after a while on it&apos;s own'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-7872871439294198934</id><published>2011-07-17T19:18:00.000-07:00</published><updated>2011-07-17T19:18:36.069-07:00</updated><title type='text'>The page has one or more asp:Content controls that do not correspond with asp:ContentPlaceHolder controls in the Master Page.</title><content type='html'>I kept getting this error in the design view:&lt;br /&gt;&lt;blockquote&gt;The page has one or more &amp;lt;asp:Content&amp;gt; controls that do not correspond with &amp;lt;asp:ContentPlaceHolder&amp;gt; controls in the Master Page.&lt;/blockquote&gt;A few Google searches, this is what I found to work for me:&lt;br /&gt;&lt;blockquote&gt;Setting&lt;br /&gt;&lt;b&gt;&amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/b&gt;&lt;br /&gt;instead of&lt;br /&gt;&lt;b&gt;&amp;lt;title /&amp;gt;&lt;/b&gt;&lt;br /&gt;solved the problem.&lt;/blockquote&gt;&lt;a href="http://forums.asp.net/t/1302708.aspx"&gt;http://forums.asp.net/t/1302708.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-7872871439294198934?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/7872871439294198934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/07/page-has-one-or-more-aspcontent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/7872871439294198934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/7872871439294198934'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/07/page-has-one-or-more-aspcontent.html' title='The page has one or more asp:Content controls that do not correspond with asp:ContentPlaceHolder controls in the Master Page.'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-7045267614195660874</id><published>2011-07-01T20:58:00.000-07:00</published><updated>2011-07-01T20:58:18.387-07:00</updated><title type='text'>Skype in the Windows 7 taskbar</title><content type='html'>Try searching Google to see how to get rid of the Skype icon off the taskbar. &amp;nbsp;There are mostly results that instruct changing the shortcut's Compatibility mode to SP2. &amp;nbsp;That sounds clever but Skype itself directly supports this.&lt;br /&gt;&lt;br /&gt;Open Skype...&lt;br /&gt;Click Tools in the menu bar...&lt;br /&gt;Click the Options menu item...&lt;br /&gt;a new window will open, click the Advanced button on the bottom left of the new window...&lt;br /&gt;&lt;br /&gt;Skype should have a checkbox entry that says&lt;br /&gt;"Keep Skype in the taskbar while I'm signed in."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-7045267614195660874?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/7045267614195660874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/07/skype-in-windows-7-taskbar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/7045267614195660874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/7045267614195660874'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/07/skype-in-windows-7-taskbar.html' title='Skype in the Windows 7 taskbar'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-4270133629390907575</id><published>2011-06-29T12:17:00.000-07:00</published><updated>2011-06-29T12:17:50.082-07:00</updated><title type='text'>UpdatePanel isn't working, ScriptManager seems to not be rendering?</title><content type='html'>Where to start... I was using RadAjaxPanel with a standard ListBox and AutoPostBack enabled. &amp;nbsp;After clicking the new ListItem, the event would not fire. &amp;nbsp;Turns out that the RadAjaxPanel I was using was out-of-date that I believe was targeting the .NET 2.0 Framwork. &amp;nbsp;This would be a good time to explore using the standard .NET 4.0 UpdatePanel.&lt;br /&gt;&lt;br /&gt;I found several demos that worked on their own in a new 4.0 project. &amp;nbsp;However when adding the demo code to our existing project, it didn't work. &amp;nbsp; The project had been updated from 1.1, to 2.0 to now 4.0 and it might have &amp;nbsp;even been upgraded from 1.0 to 1.1 - it's been around a while now.&lt;br /&gt;&lt;br /&gt;I noticed that the demo's rendered HTML had a few things different from our implimentation of the demo. &amp;nbsp;Where the ScriptManager was at, the demo had:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;//&amp;lt;![CDATA[&lt;br /&gt;Sys.WebForms.PageRequestManager._initialize('scriptMgr', 'form1', ['tupdatePnl','updatePnl'], [], [], 90, '');&lt;br /&gt;//]]&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;and a LOT more google searching, led me to checking over the Web.Config for proper entries:&lt;br /&gt;&lt;br /&gt;Turns out I was missing this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;controls&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/controls&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/pages&amp;gt;&lt;/blockquote&gt;&lt;div&gt;and this had to be removed:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&amp;nbsp; &amp;nbsp; &amp;lt;xhtmlConformance mode="Legacy"/&amp;gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.java2s.com/Code/ASP/Ajax/ConfigureWebConfiginordertouseaspScriptManager.htm"&gt;http://www.java2s.com/Code/ASP/Ajax/ConfigureWebConfiginordertouseaspScriptManager.htm&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://stackoverflow.com/questions/6181290/updatepanel-no-errors-but-web-config-settings-required"&gt;http://stackoverflow.com/questions/6181290/updatepanel-no-errors-but-web-config-settings-required&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-4270133629390907575?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/4270133629390907575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/06/updatepanel-isnt-working-scriptmanager.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/4270133629390907575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/4270133629390907575'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/06/updatepanel-isnt-working-scriptmanager.html' title='UpdatePanel isn&apos;t working, ScriptManager seems to not be rendering?'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-8949076243639896305</id><published>2011-06-28T08:25:00.000-07:00</published><updated>2011-06-28T08:25:42.095-07:00</updated><title type='text'>View DOM Source</title><content type='html'>Often times the original View Source in a web browser is not sufficient for developers due to AJAX, jQuery, etc.. &amp;nbsp;The developer tools in IE 8 (access by pressing F12) are pretty useful, but today I stumbled on View DOM Source.&lt;br /&gt;&lt;br /&gt;Access it by View, Source, DOM (Page) - or press Ctrl+G&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-8949076243639896305?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/8949076243639896305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/06/view-dom-source.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8949076243639896305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8949076243639896305'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/06/view-dom-source.html' title='View DOM Source'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-8589400448373101156</id><published>2011-05-26T05:35:00.000-07:00</published><updated>2011-05-26T05:36:53.782-07:00</updated><title type='text'>VHD Corruption - Not cool, UGH.</title><content type='html'>Quick description of my setup... I do my dev work in VMs, in this particular case I have a Win7 host with my VM file on a Bitlocker partition.&amp;nbsp; I'm&amp;nbsp;using Oracle VirtualBox to access a Win7 guest, that has like ~140GB dynamic drive, ~actual size 40GB.&lt;br /&gt;&lt;br /&gt;While restoring a DB in SSMS 2008, the VM drive grows with the restore and fills the host drive.&amp;nbsp; Of course SSMS and the guest Win7 doesn't report being out of space, b/c technically the VM drive isn't out of space.&amp;nbsp; VirtualBox doesn't say it's out of space... why?&amp;nbsp; That's a good question, but if I could have saved a lot of grief if it threw up something like "Hey your VM is trying to write to the drive and it's out of space.&amp;nbsp; Your VM has been paused.&amp;nbsp; Retry?&amp;nbsp; Abort?"&lt;br /&gt;&lt;br /&gt;Anyhow, VirtualBox along with everything else on my box is halting "This process is not responding..."&lt;br /&gt;&lt;br /&gt;Not cool.&amp;nbsp; UGH.&amp;nbsp; More digging, I kill the VirtualBox task.&amp;nbsp; Restart VirtualBox.&amp;nbsp; Error with drive:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Failed to open the hard disk D:\abcde.vhd.&lt;br /&gt;Could not get teh storage format of the medium 'D:\abcde.vhd' (VERR_NOT_SUPPORTED).&lt;br /&gt;Result Code: &lt;br /&gt;&amp;nbsp;VBOX_E_IPRT_ERROR (0x80BB0005)&lt;br /&gt;&lt;br /&gt;Component: &lt;br /&gt;&amp;nbsp;Medium&lt;br /&gt;&lt;br /&gt;Interface: &lt;br /&gt;&amp;nbsp;IMedium {1d578f43-5ef1-4415-b556-7592d3ccdc8f}&lt;br /&gt;&lt;br /&gt;Callee: &lt;br /&gt;&amp;nbsp;IVirtualBox {3f36e024-7fed-4f20-a02c-9158a82b44e6}&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Immediately copy the broken VHD to an external drive.&lt;br /&gt;&lt;br /&gt;Not cool.&amp;nbsp; UGH.&amp;nbsp; More digging, I try mounting the VHD in Win7...Start, Computer Management, Disk Management, Action, Attach VHD, and I get this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;The file or directory is corrupted and unreadable.&lt;/blockquote&gt;&lt;br /&gt;Not cool.&amp;nbsp; UGH.&amp;nbsp; More digging, I found a post about using WinImage (&lt;a href="http://www.winimage.com/"&gt;http://www.winimage.com/&lt;/a&gt;)&amp;nbsp;to read the VHD.&amp;nbsp; So I open it in WinImage and woohoo it opened... except half my data is missing.&amp;nbsp; The C:\Users folder isn't even listed.&lt;br /&gt;&lt;br /&gt;Not cool.&amp;nbsp; UGH.&amp;nbsp; More digging, I came across a bunch of other posts and disregarded them, then later wanted to go back to it but couldn't find them.&amp;nbsp; The gist of it was that a person fixed their corrupted header on their dynamic VHD by using a utility to convert it to a fixed size VHD.&amp;nbsp; The result should be that my 120GB dynamic VHD would result in a 40GB fixed size VHD.&amp;nbsp; They had a link to VHDTool (&lt;a href="http://archive.msdn.microsoft.com/vhdtool"&gt;http://archive.msdn.microsoft.com/vhdtool&lt;/a&gt;) so I figured I'd give it a whirl.&amp;nbsp; Data should be intact and just have a new header.&lt;br /&gt;&lt;br /&gt;Run the utility to convert to fixed size, seems ok, open in WinImage, files still there.&amp;nbsp; Mount in Win7, error.&amp;nbsp; VHD looks like one big blob of unformatted space.&amp;nbsp; Try VirtualBox... the VHD mounts, but it won't boot.&amp;nbsp; Makes sense.&amp;nbsp; It's now a fixed size VHD with 0 free bytes.&amp;nbsp; Mount to a diff VM as a secondary drive.&amp;nbsp; Boot,&amp;nbsp;OS says the secondary drive needs to be formatted.&lt;br /&gt;&lt;br /&gt;Not&amp;nbsp;cool.&amp;nbsp; UGH.&amp;nbsp; More digging, but nothing new to try yet.&amp;nbsp; So I figure the VHD has a new header now, and I can see my data in WinImage... So I'll just try&amp;nbsp;converting&amp;nbsp;back to a dynamic drive again and see&amp;nbsp;if I can then boot.&lt;br /&gt;&lt;br /&gt;Guess what I learned.&amp;nbsp;&amp;nbsp; WinImage has menus!&amp;nbsp; And under those menus are various little neat tricks... like.... Disk, Convert VHD image...&lt;br /&gt;&lt;br /&gt;I convert the new fixed size VHD, to a dynamic VHD, WinImage shows the new data, but still missing C:\Users.&amp;nbsp; I try mounting in Win7, drive mounts!&amp;nbsp; VirtualBox media manager opens the VHD!&amp;nbsp; Boot the Win7 OS..... SUCCESS!!!! :)&lt;br /&gt;&lt;br /&gt;Looking back, WinImage was able to see the contents of the original corrupted VHD, so maybe I could have used it to open the corrupt VHD and then immediately re-write it back out, without having to use the Microsoft tool.&amp;nbsp; If the VHD corrupts a 2nd time, then I'll try that ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-8589400448373101156?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/8589400448373101156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/05/vhd-corruption.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8589400448373101156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/8589400448373101156'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/05/vhd-corruption.html' title='VHD Corruption - Not cool, UGH.'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3467743484223235841.post-5364791769329437231</id><published>2011-05-26T04:53:00.000-07:00</published><updated>2011-05-26T04:53:03.800-07:00</updated><title type='text'>Every blog needs a first post.</title><content type='html'>As a programmer, I *know* I should be contributing back to the community, but it's always been on the back burner.&amp;nbsp; I also *know* that I, like many other programmers, do not enjoy writing documentation.&amp;nbsp; Anyhow, I thought my most recent situation is worth documenting because wow I was in quite a pinch.&amp;nbsp; So... I guess it's time to start a blog!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3467743484223235841-5364791769329437231?l=jamesnearn.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jamesnearn.blogspot.com/feeds/5364791769329437231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jamesnearn.blogspot.com/2011/05/every-blog-needs-first-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/5364791769329437231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3467743484223235841/posts/default/5364791769329437231'/><link rel='alternate' type='text/html' href='http://jamesnearn.blogspot.com/2011/05/every-blog-needs-first-post.html' title='Every blog needs a first post.'/><author><name>James</name><uri>http://www.blogger.com/profile/09764376595583106781</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
