<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">&lt;img src="http://forums.asp.net/Themes/default/images/forum_private_newposts.gif" align=left border=</title><subtitle type="html"> Diary of an &lt;i&gt;ASP.NET&lt;/i&gt; bodger</subtitle><id>http://weblogs.asp.net/dbarrow/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/dbarrow/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2003-06-09T22:27:00Z</updated><entry><title>Stuck</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2005/05/29/409632.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2005/05/29/409632.aspx</id><published>2005-05-29T15:17:00Z</published><updated>2005-05-29T15:17:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Arial" size="2"&gt;I've been going through Jason Bere's excellent book - Teach Yourself Visual Studio.NET 2003 in 21 Days as a way of re-acquainting myself with both developing and the .NET framework etc. I've been faithfully doing a day at a time, but now... I'm stuck, and apparently its because I'm a smart-arse with SQL2005 instead of SQLExpress. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;Day 5 - Writing ASP.NET applications is &lt;A href="http://weblogs.asp.net/dbarrow/articles/Learn_visual_studio_in_21_days_day_5.aspx"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=409632" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Getting Started" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Getting+Started/default.aspx" /></entry><entry><title>Learn .NET in 21 days/60 minutes/24 hours....</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2005/05/26/Learn-dot-net-in-a-ridiculously-short-time.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2005/05/26/Learn-dot-net-in-a-ridiculously-short-time.aspx</id><published>2005-05-26T21:14:00Z</published><updated>2005-05-26T21:14:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Arial" size="2"&gt;Can it be done???&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;Not wanting to blow my own trumpet but I'm fairly clever, done a bit of .NET and kind of know my way around the framework. As you all probably know by now, I've not touched an IDE in 12 months (true) and not even been online in the past year (IT CAN BE DONE!!! YOU DON'T DIE!!!!!!) so surely I of all peeps should be able to fulfull the prediction of these books...&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;Roll up, Roll up...watch me make an arse of myself lol.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;First article is &lt;A href="http://weblogs.asp.net/dbarrow/articles/learn_visual_studio_NET_in_21_days_day_1.aspx"&gt;here&lt;/a&gt;..&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=409105" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /><category term="Getting Started" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Getting+Started/default.aspx" /></entry><entry><title>Tripping over my own laces.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2005/05/22/408278.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2005/05/22/408278.aspx</id><published>2005-05-22T17:58:00Z</published><updated>2005-05-22T17:58:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Arial" size="2"&gt;After almost exactly 12mths of not having picked up Visual Studio (or been online for that matter) I find that&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;a) I have a ton of email to sort through&lt;br /&gt;b) I can't remember how to tie my own shoe-laces (figuratively speaking)&lt;br /&gt;c) My typing has gone to ratsh*t.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Arial" size="2"&gt;So, without looking at any websites or books, just how far can an extremely rusty developer get using Visual Studio 2005?&lt;br /&gt;Let the bodging begin&lt;br /&gt;&lt;A href="http://weblogs.asp.net/dbarrow/articles/remembering_how_to_program.aspx"&gt;http://weblogs.asp.net/dbarrow/articles/remembering_how_to_program.aspx&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=408278" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Getting Started" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Getting+Started/default.aspx" /></entry><entry><title>Where are your bottlenecks?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2004/03/29/101151.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2004/03/29/101151.aspx</id><published>2004-03-29T15:11:00Z</published><updated>2004-03-29T15:11:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Arial size=2&gt;I'm sure most people reading this will be aware of the joys of trace.view but I've never *really* got it to show me where my main bottlenecks are. It's just a bit too much like hard work to be honest.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Enter &lt;STRONG&gt;ANTS profiler&lt;/STRONG&gt;.&lt;BR&gt;Absolutely superb piece of kit that needs to be in every developers toolkit - whether ASP.NET or winforms. Even those freaky C# guys.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;What it does is sit in the background while you run your app, clicking about and emulating the actions of a user.&lt;BR&gt;When you've finished, it opens up a history of activity, the top 100 slowest functions and allows you to actually drill down into the relevent piece of code. There's even a nice little red bar for those really slow calls.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;S'very nice. You can get it here&lt;BR&gt;&lt;/FONT&gt;&lt;A href="www.red-gate.com"&gt;&lt;FONT face=Arial size=2&gt;www.red-gate.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;&amp;nbsp;If you're serious about tweaking your code, I definitely think its worth it.&lt;BR&gt;However, if you're happy with functions that take 2seconds - stick with the trace :P&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=101151" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>New article - creating a custom repeater with custom caching and sorting..</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2004/03/17/91161.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2004/03/17/91161.aspx</id><published>2004-03-17T13:31:00Z</published><updated>2004-03-17T13:31:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Arial size=2&gt;A recent requirement was to create a web-page that sorted ascending then descending based on the last sort per column. I could have extended a datagrid to do my bidding but I ended up creating my own system due to some logic that needed applying to one of the columns (If conditionA then bgColor=Red).&lt;BR&gt;That kind of logic was easy enough to accomplish in classic asp but I found it difficult to do to with a datagrid.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The article is &lt;/FONT&gt;&lt;A href="http://weblogs.asp.net/dbarrow/articles/Custom_Caching.aspx"&gt;&lt;FONT face=Arial size=2&gt;here &lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;- any feedback appreciated and will of course be incorporated.&lt;BR&gt;Also, if you can tell me how to navigate to my articles, I'd be very grateful lol!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=91161" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Designers and Developers can live together.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2004/02/19/76359.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2004/02/19/76359.aspx</id><published>2004-02-19T16:15:00Z</published><updated>2004-02-19T16:15:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Arial size=2&gt;We've been trying to find a solution whereby the totally none-coding designer works with the crayola wielding developers and the simple "Make a static page with some content" people. Dreamweaver templates are excellent for this but VS.NET makes them an impossible solution. &lt;BR&gt;&lt;BR&gt;What happens is the template inserts a comment just below the HEAD tag of the simple html page.&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#808080&gt;&amp;lt;!-- InstanceBegin template="/Templates/test.dwt.aspx" codeOutsideHTMLIsLocked="false" --&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The designer saves the page, it all works and then&amp;nbsp;the developer sets about making it work. As soon as they open the page in design view, the template is screwed because VS.NET moves the instanceBegin comment to after the title tag&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial color=#808080 size=2&gt;&amp;nbsp;&amp;lt;HEAD&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;template&amp;lt;/title&amp;gt;&lt;BR&gt;&amp;lt;!-- InstanceBegin template="/Templates/test.dwt.aspx" codeOutsideHTMLIsLocked="false" --&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The consequence of this is that Dreamweaver now finds nested editable regions, therefore breaking the functionality of the template 'philosophy'.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;A href="http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=457479"&gt;http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=457479&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;A href="http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=441814"&gt;http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=441814&lt;/A&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;A href="http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=391742"&gt;http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=391742&lt;/A&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;o:p&gt;Now, I'm led to believe that Whidbey leaves your code alone and b&lt;/o:p&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;asically, I can&amp;#8217;t progress some kind of totally safe shared environment without that functionality. Dreamweaver is an awesome web design tool - especially when coupled with Photoshop and someone who knows how to use it (If you're reading this, then you aren't one of those people :P )&lt;BR&gt;&lt;BR&gt;VS.NET will always screw over your code so while Dreamweaver is the tool of choice for frontend stuff, it won&amp;#8217;t work with VS.NET (nothing will as VS.NET html mangles everything). However, code development with VS.NET is 10 times quicker than with any other IDE that I know of so whatever solution we use, it has to be VS.NET compatible, not the other way round.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I've looked at BasePages and they seem cool - John Rebbeck and Russ Neimhausers articles are succinct and clear but IMO its not going from A to B when all you want to do is server HTML with some dynamic content. Surely the fastest served page is control light with pure HTML in - not something that is inherited and processed, and then controls moved here and there to make it fit?&lt;BR&gt;&lt;BR&gt;So - Whidbey - is it what I'm led to believe it is? I'll let you know.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=76359" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Rants" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Rants/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Bluetooth - you get what you pay for.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2004/02/08/69548.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2004/02/08/69548.aspx</id><published>2004-02-08T09:42:00Z</published><updated>2004-02-08T09:42:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;So, I got two bluetooth dongles (Zeevo BT500 stack), plugged them in the old USB sockets and away we go... no?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Bugger. Bluetooth won't work with Server 2003. I did some searching and found Brian Desmonds blog on the subject, but the end result is - bluetooth doesn't work with Microsofts flagship product (which I love btw). Switch to XP Pr - install the software and way we go.. no?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;No. The default installation all runs against the LAN 1 connection (of course I already have a lan, i'm a network dude fer crissakes) so with some tcp/ip tomfoolery, away we go.. no? &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;NO! If the client laptop is not positioned in the absolute correct position, then you lose the signal. &lt;BR&gt;What I wanted was a cheap alternative to a wireless network. I figured - hey, Bluetooth, 10m connectivity, away we go. No. What you actually get is an upgrade to line-of-sight infra-red connectivity - its pants. If someone walks past the two devices, you lose it. Forget about closing doors or through walls - it no workee. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Upshot? Buy wireless. Bluetooth is useless other than for keyboards and mobile phones that are sat within 3inches of the damn host dongle.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=69548" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Rants" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Rants/default.aspx" /></entry><entry><title>Contract - or work for a living?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2004/02/04/67296.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2004/02/04/67296.aspx</id><published>2004-02-04T10:31:00Z</published><updated>2004-02-04T10:31:00Z</updated><content type="html">&lt;P&gt;Recently, on a list serv that I'm on (Uk webdevelopers - &lt;A href="http://www.mswebdev.org.uk/"&gt;http://www.MsWebDev.org.uk/&lt;/A&gt;&amp;nbsp;) we were discussing the ups and downs of being a developer. Money came up, as it does, and then the current high rates for contracting.&lt;BR&gt;&lt;BR&gt;My own view is that is a short lived affair - and that it will happen less and less. My reasoning? .NET.&lt;BR&gt;Microsoft have got it right now, and I mean properly right. Totally right. Well, maybe a couple of bugs here and there but if you can throw a datalist object back and forth like a tennis ball, in a proper object oriented fashion, and it makes no difference what language its in - surely someone somewhere should be saying "Ok, we give in.You win!"&lt;/P&gt;
&lt;P&gt;So, companies are now happy to embrace the .NET framework into their business (or so it would appear from the recent demand for contractors). &lt;/P&gt;
&lt;P&gt;However, will that demand last? &lt;BR&gt;Will we see a return to the heady days of constant &amp;#163;500 a day contracts or will (as I suspect) expectations rise and therefore demands rise for increasingly complex web apps?&lt;/P&gt;
&lt;P&gt;I dunno, cos I'm off out of it. .NET will be my hobby&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=67296" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Rants" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Rants/default.aspx" /></entry><entry><title>Powervault 220s, Databases &amp; BACKUPS</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/10/21/32762.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/10/21/32762.aspx</id><published>2003-10-21T09:49:00Z</published><updated>2003-10-21T09:49:00Z</updated><content type="html">&lt;P&gt;Ok. Don't panic but BACK YER FREAKING DATA UP NOW!!!&lt;/P&gt;
&lt;P&gt;We have&amp;nbsp;a Powervault 220s which we use half for the mailboxes and half for the main database server. Its on RAID 5, has just had new drives installed and the power supply scrubbed. We also have a well thought out (so we thought) backup solution using tapes and Backup Exec. Anyway, at 3.51pm on Saturday, it all went tits up. The powervault was just dead. Powered off and on again and it came back up but the drives were offline apart from the hotspare. Nightmare. That's like 90% of the business critical stuff. DELL were helpful, but not really much help - they suggested swapping power leads which wasn't it but I'm not getting at Geoff the support dude, I know how hard support can be.&lt;/P&gt;
&lt;P&gt;We finally found a solution in the form of this link here&lt;BR&gt;&lt;A href="http://forums.us.dell.com/supportforums/board/message?board.id=pv_raid&amp;amp;message.id=214&amp;amp;view=by_date_ascending&amp;amp;page=1"&gt;http://forums.us.dell.com/supportforums/board/message?board.id=pv_raid&amp;amp;message.id=214&amp;amp;view=by_date_ascending&amp;amp;page=1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would appear that there is an issue with the 220s. Problem is - the powervault doesn't look like a computer and there's no floppy or keyboard.. so the existance of firmware just didn't occur to me. I realise this is poor logic but *it just didn't* ok?? The loing and short of it is that the databases and mailboxes are corrupted. We have backups but it takes forever to restore from tape with Backup exec (6hrs for 16gig of mail... that can't be right can it??) and we lost two tables. &lt;/P&gt;
&lt;P&gt;Upshot is I'm revisitng our backup strategy. As well as the backup exec, I think we also need to be doing differentials as well, and full backups to another server entirely so that we can restore to another machine and at least get back to work. And we need to do drills and simulated crashes. Disaster can strike anytime so BACK YER FREAKING DATA UP NOW!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=32762" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author></entry><entry><title>Patching</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/08/15/24195.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/08/15/24195.aspx</id><published>2003-08-15T09:15:00Z</published><updated>2003-08-15T09:15:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Ok. I'm sure most of you have read some article here or there about MS Patching and RPC exploit, MSBLast.exe etc etc.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;As a web developer who also picks up overflow IT helpdesk calls, I can firmly say MS HAVE GOT IT WRONG!&lt;br /&gt;Many of our help-desk clients are computer users, just as I am a car driver. If my carburettor broke, I'd have to get someone to fix it, but I can change my own oil and water, put air in the tyres etc. I know other car drivers though who can't. I also know people who have baths and taps, but they don't lag their pipes, or flush them through with pipe-cleaner every year.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I could go on, but I think you get the picture.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;MS need to adopt the stance that there are some users who do not know how to put a URL in the address bar. Their argument might be that there is the windows update icon in the start list and the tools menu, and every now &amp;amp; then, you're forced to go to the update page. I like that, I really do, but techno-phobes DO NOT READ, nor do they comprehend that their badly patched system could help in bringing down the internet, or a power station (!), the Stock Market - whatever.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;If some kid from Elbonia can infect your machine with a worm that does a,b,c then surely MS could do the same but in a positive way. The 16th July patch should have been forced onto everyones computers, like it or not. There would be issues with that, sure, like you couldn't put it on Win2k SP2, or NT4 pre SP6. Sometimes, the patch broke Office, which then required imaged machines to have the original install disks. But in the long run, things should have been better. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;This time, I think the internet got off lightly. I'm not so sure if next time will be so painless. What if some disgruntled musician hacker decides to attack every machine in the world that has Kazaa on it? What then? And then someone decides to have a pop at people playing Counter Strike, or whatever.&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;The below snip from MS, aimed at people who are interested in security and are therefore likely patched anyway, is too little too late.&lt;/font&gt;&lt;br /&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;You are receiving this message because you are a Microsoft newsletter subscriber. Please print this page for your reference. &lt;br /&gt;It is very important that you check the Security site regularly for the most recent news: &lt;a href="http://go.microsoft.com/?linkid=221015"&gt;&lt;u&gt;&lt;font color="#0000ff" size="2"&gt;http://go.microsoft.com/?linkid=221015&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;In This Newsletter:&lt;/p&gt;
&lt;p&gt;--Who Is Vulnerable&lt;br /&gt;--4 Steps for Home Users&lt;/p&gt;
&lt;p&gt;At 11:34 A.M. Pacific Time on August 11, Microsoft began investigating a worm reported by Microsoft Product Support Services (PSS). A new worm commonly known as W32.Blaster.Worm has been identified that exploits the vulnerability that was addressed by Microsoft Security Bulletin MS03-026.&lt;/p&gt;
&lt;p&gt;Who Is Vulnerable?&lt;/p&gt;
&lt;p&gt;Users of the following products are vulnerable to infection by this worm:&lt;br /&gt;. Microsoft® Windows NT® 4.0 &lt;br /&gt;. Microsoft Windows® 2000 &lt;br /&gt;. Microsoft Windows XP &lt;br /&gt;. Microsoft Windows Server(TM) 2003 &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=24195" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author></entry><entry><title>XP blue screen - NTFS error</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/06/30/9464.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/06/30/9464.aspx</id><published>2003-06-30T09:40:00Z</published><updated>2003-06-30T09:40:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Verdana" size="2"&gt;So, my mates machine with XP Home on started crashing on him. Me being a bad friend, I failed to go round in time to stop him formatting the whole drive. He continued to get the error, which was on boot - &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Unmountable_boot_voume&lt;br /&gt; &lt;br /&gt;***STOP: 0x000000ED (0x82B6A900, 0xC0000185, 0x00000000, 0x00000000, 0x00000000)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;Then you'd get random NTFS errors or NTLDR missing etc.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I removed the new RAM he'd just bought and all fixed. Put the RAM back in and you got the Pac-Man noise. He'd googled for it but got no joy, so I thought I'd post this up in case anyone else gets fried in the same way.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9464" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author></entry><entry><title>Sneaky trick with the Javascript back button</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/06/19/8953.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/06/19/8953.aspx</id><published>2003-06-19T10:49:00Z</published><updated>2003-06-19T10:49:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Verdana" size="2"&gt;On one of our new sites (Still in development) I needed a javascript slideshow of the hotel images. Problem was, the back button held onto each flip through, so to return to the previous page involved a number of hits on the back button.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I looked into the history object, replacing it and generally mucking about with it but after much messing about I discovered a hack which works nicely for me.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;I used an IFrame to display the slideshow page, and used an alternate domain name for that page - eg, we have &lt;a href="http://www.travelcounsellors.com"&gt;www.travelcounsellors.com&lt;/a&gt; and &lt;a href="http://www.travelcounsellors.co.uk"&gt;www.travelcounsellors.co.uk&lt;/a&gt;.  Because the IFrame referenced &lt;a href="http://www.travelcounsellors.com"&gt;www.travelcounsellors.com&lt;/a&gt;, it didn't hold the history of co.uk so happy days :). I then thought, hey, what if its not an ASP.NET page, but just an asp page in the same domain? Then it would be part of a different application? That works too...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;&lt;a href="http://www.travelcounsellors.com/Offers/offer_detail.aspx?theDate=2003-05-01T00:00:00&amp;amp;cty=Caribbean&amp;amp;rst=Barbados&amp;amp;offer_id=11614&amp;amp;op=1129&amp;amp;nts=14&amp;amp;hcode=TAM813&amp;amp;dd1=17/08/2003&amp;amp;dd2=28/11/2003"&gt;Here's &lt;/a&gt;what I mean&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8953" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Reusing SQLCOmmand - revisited :)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/06/17/8827.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/06/17/8827.aspx</id><published>2003-06-17T17:17:00Z</published><updated>2003-06-17T17:17:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Verdana"&gt;&lt;font size="2"&gt;With regards to SQL-Injection attacks, I wasn't too concerned as it was a windows service I was writing. However, the poke about performance got me thinking. Would it really be any quicker with parameters, when I was just calling a sproc a few times. &lt;br /&gt;&lt;br /&gt;Kirk Allen Evans (Good book btw) had these points to make&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;em&gt;Second, you will get better performance by using a parameterized SQL statement by replacing the literal values with question marks and using parameters in place of the literal values. The parameters can then be reused as well, where you simply set the values during each iteration. &lt;br /&gt;&lt;br /&gt;Third, you can enhance performance a little more if your provider supports the .Prepared property for the Command object. The .Prepared property pre-compiles the SQL statement and caches it, avoiding parses for invaalid SQL statements.&lt;/em&gt;&lt;/font&gt; &lt;br /&gt;&lt;br /&gt;So, I needed to convert this module to run in a more optimised way.&lt;br /&gt;&lt;br /&gt;&lt;font face="Courier New" color="darkgreen" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt; Main()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; startTime &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt;.Now&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; myConn &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; SqlConnection = &lt;/font&gt;&lt;font size="2"&gt;New&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" color="darkgreen" size="2"&gt; SqlConnection("server=xxx; user id=xxx; password=xxx; database=xxx")&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt;myConn.Open()&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; main_startDate &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;.Today.AddDays(5)&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; startDate &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt;.Today.AddDays(5)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;Console.WriteLine("Today=" &amp;amp; startDate.ToString("s"))&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; mySQL &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;New&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt; SqlCommand("exec tcHolidays.dbo.TCHolidays_Get_Hotel_Costs 2,0,1,'" &amp;amp; startDate.ToString("s") &amp;amp; "',3,'','','Boston',9999,0", myConn)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;mySQL.ExecuteNonQuery()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen" size="2"&gt;Dim&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt; resorts(4)&lt;br /&gt;  resorts(0) = "New York"&lt;br /&gt;  resorts(1) = "Orlando"&lt;br /&gt;  resorts(2) = "Miami"&lt;br /&gt;  resorts(3) = "Las Vegas"&lt;br /&gt;  resorts(4) = "Boston"&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; resort &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;String&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;For&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;Each&lt;/font&gt;&lt;font size="2"&gt; resort &lt;/font&gt;&lt;font size="2"&gt;In&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt; resorts&lt;/font&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;While&lt;/font&gt;&lt;font size="2"&gt; startDate &amp;lt; &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt;.Today.AddDays(10)&lt;/font&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;mySQL.CommandText = "exec tcHolidays.dbo.TCHolidays_Get_Hotel_Costs 2,0,1,'" &amp;amp; startDate.ToString("s") &amp;amp; "',7,'','','" &amp;amp; resort &amp;amp; "',9999,0"&lt;br /&gt;mySQL.ExecuteNonQuery()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#006400"&gt;mySQL.CommandText = "exec tcHolidays.dbo.TCHolidays_Get_Hotel_Costs 2,0,1,'" &amp;amp; startDate.ToString("s") &amp;amp; "',10,'','','" &amp;amp; resort &amp;amp; "',9999,0"&lt;br /&gt;mySQL.ExecuteNonQuery()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="#006400"&gt;mySQL.CommandText = "exec tcHolidays.dbo.TCHolidays_Get_Hotel_Costs 2,0,1,'" &amp;amp; startDate.ToString("s") &amp;amp; "',14,'','','" &amp;amp; resort &amp;amp; "',9999,0"&lt;br /&gt;mySQL.ExecuteNonQuery()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;mySQL.CommandText = "Exec tcHolidays.dbo.TCHolidays_get_Flights '" &amp;amp; startDate.ToString("s") &amp;amp; "','" &amp;amp; resort &amp;amp; "'"&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;mySQL.ExecuteNonQuery()&lt;br /&gt;startDate = startDate.AddDays(1)&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;Console.WriteLine("Done flights and Hotels for " &amp;amp; startDate.ToShortDateString() &amp;amp; " in " &amp;amp; resort &amp;amp; ".")&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;While&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;startDate = main_startDate&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font face="Courier New" color="darkgreen"&gt;Next&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen"&gt;myConn.Close()&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; endTime &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;font size="2"&gt; = &lt;/font&gt;&lt;font size="2"&gt;Date&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt;.Now&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; timeSpan &lt;/font&gt;&lt;font size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt; TimeSpan = endTime.Subtract(startTime)&lt;br /&gt;Console.WriteLine("Process took " &amp;amp; timeSpan.ToString() &amp;amp; ".")&lt;br /&gt;Console.WriteLine("Press enter..")&lt;br /&gt;Console.ReadLine()&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="darkgreen" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font&gt;&lt;font face="Verdana" color="black" size="2"&gt;Doing it this way took 1.21.044 (m.s.ms)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Verdana" size="2"&gt;To answer Kirks first point, I needed to parametise two stored procedures. I did this outside of the main loop, meaning I could reuse the parameters as suggested.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="darkgreen"&gt;Dim mySQL As SqlCommand = New SqlCommand&lt;br /&gt;With mySQL&lt;br /&gt;.CommandText = "tcHolidays.dbo.TCHolidays_get_hotel_costs"&lt;br /&gt;.CommandType = CommandType.StoredProcedure&lt;br /&gt;.Connection = myConn&lt;br /&gt;.Parameters.Add(New SqlParameter("@num_Adults", SqlDbType.Int))&lt;br /&gt;.Parameters("@num_Adults").Value = 2&lt;br /&gt;.Parameters.Add(New SqlParameter("@num_Children", SqlDbType.Int))&lt;br /&gt;.Parameters("@num_Children").Value = 0&lt;br /&gt;.Parameters.Add(New SqlParameter("@num_Rooms", SqlDbType.Int))&lt;br /&gt;.Parameters("@num_Rooms").Value = 1&lt;br /&gt;.Parameters.Add(New SqlParameter("@theDate", SqlDbType.VarChar, 20))&lt;br /&gt;.Parameters.Add(New SqlParameter("@nights", SqlDbType.Int))&lt;br /&gt;.Parameters.Add(New SqlParameter("@hcode", SqlDbType.VarChar, 30))&lt;br /&gt;.Parameters("@hcode").Value = ""&lt;br /&gt;.Parameters.Add(New SqlParameter("@country", SqlDbType.VarChar, 30))&lt;br /&gt;.Parameters("@country").Value = ""&lt;br /&gt;.Parameters.Add(New SqlParameter("@resort", SqlDbType.VarChar, 30))&lt;br /&gt;.Parameters.Add(New SqlParameter("@maxPrice", SqlDbType.Int))&lt;br /&gt;.Parameters("@maxPrice").Value = 9999&lt;br /&gt;.Parameters.Add(New SqlParameter("@minPrice", SqlDbType.Int))&lt;br /&gt;.Parameters("@minPrice").Value = 0&lt;br /&gt;End With&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&lt;font face="Verdana" color="black"&gt;Inside the main loop, I then simply change the values of those parameters which change inside the loops:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="darkgreen" size="2"&gt;With&lt;/font&gt;&lt;font color="darkgreen"&gt;&lt;font size="2"&gt; mySQL&lt;br /&gt;.Parameters("@theDate").Value = startDate.ToString("s")&lt;br /&gt;.Parameters("@nights").Value = 7&lt;br /&gt;.Parameters("@resort").Value = resort&lt;br /&gt;.Prepare()&lt;br /&gt;.ExecuteNonQuery()&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="darkgreen"&gt;With&lt;/font&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font face="Verdana"&gt;&lt;font color="black"&gt;Because I was reusing the mySQL.Command - I needed another sqlCommand object&lt;/font&gt;&lt;font color="black"&gt; for the last sproc, which obtains flights.&lt;/font&gt;&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="Courier New" color="darkgreen" size="2"&gt;With&lt;/font&gt;&lt;font color="darkgreen"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt; myFlight_SQL&lt;br /&gt;.Parameters("@theDate").Value = startDate.ToString("s")&lt;br /&gt;.Parameters("@resort").Value = resort&lt;br /&gt;.Prepare()&lt;br /&gt;.ExecuteNonQuery()&lt;br /&gt;End &lt;font color="#0000ff"&gt;&lt;font color="darkgreen"&gt;With&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font face="Verdana" color="black" size="2"&gt;Now. Doing it this way took 1.28.088... 4 seconds slower.&lt;br /&gt;So, I extended it to run over a longer period (30 days, rather than 5). The results were much the same.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font face="Verdana" size="2"&gt;With parameters: 8.52.9988944&lt;br /&gt;Without - 8.10.13825644&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font face="Verdana" size="2"&gt;Can anyone tell me where my extra 40 seconds is coming from?&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font&gt;&lt;font&gt;&lt;font face="Verdana" size="2"&gt;The upshot is that doing it parametized is *much* cleaner code. I can hand this console to anyone and they'll be able to see instantly what it is doing, and why. Downside is that it seems to be slower but I think that the extra sqlCommand has somethign to do with that.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="black"&gt;&lt;font face="Verdana"&gt;&lt;font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8827" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Re-using the SQL Command</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/06/12/8599.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/06/12/8599.aspx</id><published>2003-06-12T15:12:00Z</published><updated>2003-06-12T15:12:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Arial" size="2"&gt;Due to a freaky table schema, I had cause today to loop through a 'recordset' and then insert an amalgamated string into a database (saving me doing a ridiculous loop later on).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;I didn't see any reason to open a new SQL command once the datareader had done its job so I re-used the SQLCommand - which turned out a lot easier than I thought. Certainly a ton easier than the old recordset. After using the imports for data and data.sqlClient I simply:&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Function&lt;/font&gt;&lt;font size="2"&gt; get_description(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; hcode &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt;)
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; myQry &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = "SELECT field1 from table where hcode='" &amp;amp; hcode &amp;amp; "'"&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; mytemp_Conn &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; SqlConnection = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; SqlConnection(myConn)&lt;br /&gt;mytemp_Conn.Open()
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; myCmd &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;New&lt;/font&gt;&lt;font size="2"&gt; SqlCommand(myQry, mytemp_Conn)&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; myDr2 &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; SqlDataReader&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; Description &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = "" &lt;/font&gt;&lt;font color="#008000" size="2"&gt;' Description of the hotel&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; tempString &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = ""
&lt;p&gt;myDr2 = myCmd.ExecuteReader()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;While&lt;/font&gt;&lt;font size="2"&gt; myDr2.Read()
&lt;p&gt;tempString = myDr2.Item(0) &amp;amp; " "&lt;br /&gt;tempString = tempString.Replace("'", "''")&lt;br /&gt;Description &amp;amp;= tempString &lt;/p&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;' Concatenate each of the freaky fields.&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;While&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;myDr2.Close()&lt;/p&gt;
&lt;p&gt;myQry = "Insert into tcHolidays.dbo.hotel_Descriptions (hcode, description) values ('" &amp;amp; hcode &amp;amp; "','" &amp;amp; Description &amp;amp; "')"&lt;/p&gt;
&lt;p&gt;myCmd.CommandText = myQry&lt;br /&gt;myCmd.ExecuteNonQuery()&lt;br /&gt;mytemp_Conn.Close()&lt;/p&gt;
&lt;p&gt;Console.WriteLine("Description: {0}", Description)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Function&lt;/font&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;That was basically it! In classic I'd have had to have opened a new recordset - but now its simply wash-n-go :) &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;/font&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;/font&gt; &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8599" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/dbarrow/archive/tags/ASP.NET/default.aspx" /></entry><entry><title>Google</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/dbarrow/archive/2003/06/09/8444.aspx" /><id>http://weblogs.asp.net/dbarrow/archive/2003/06/09/8444.aspx</id><published>2003-06-09T21:27:00Z</published><updated>2003-06-09T21:27:00Z</updated><content type="html">&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;Our new sites have been up and running now for about 8 weeks. They were submitted in normal fashion, and I have not done any sneaky Google tricks like Bombing, NoText-madness or whitespacing. In fact, most of the pages aren't really well optimised. We've previously had good results with Google, achieving top 10 results for some terms and top 1 for a few select ones, which is a big achievement in travel term (We think).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;Anyway, on the last pass by the googlebot - we got a PR of...ZERO!! Nightmare I cried. Desperate to discover why, I checked the sites, checked for back links, used my toolbar to maximum effect but could still not decipher why we had a PR of Zero, which in effect kills your rankings. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;&lt;/font&gt;&lt;em&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;&amp;lt;As_I_Understand_It&amp;gt; In very short form, the PR is a modifier to your google score. You could get so many points for content, keyword positioning etc etc. Say you got an arbitrary score of 500 for your page. Your PR is derived from the PR of those pages that link to this page. if your PR is say 4 (And the PR thing is really just a nominal number plucked out of the ether) then your ranking score is 2000.   If your PR was 8, your ranking score would be 4000, etc. &amp;lt;/As_I_Understand_It&amp;gt; &lt;/font&gt;&lt;/p&gt;&lt;/em&gt;
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;font face="Tahoma" size="2"&gt;Google grabs all those links that have a certain ranking score at the end and then displays so many over a certain amount. The higher your PR, the better your chance of getting a good ranking with a poorly designed page. With a PR of 0, you have basically no chance of being up with the bad boys of SEO&lt;br /&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;Now, I'm expecting, nay, hoping, that someone will tell me different.Anyway, after much work , I found that the toolbar was being inconsistent. A page with a zero page rank was indeed still showing up in the top 10 for its term. So it *couldn't* have had a PR of 0. No way, uh uh...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;A mooch on the search engine forums reveals that what is happening is that the google toolbar is being worked on, hence its exclusion from content heavy Google main page.It even led to the Aprils fools joke about &lt;/font&gt;&lt;a href="http://www.google.com/technology/pigeonrank.html"&gt;&lt;font face="Tahoma" size="2"&gt;PigeonRank&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="2"&gt;For completeness, the sites are:&lt;br /&gt;&lt;/font&gt;&lt;a href="http://www.travelhomeworking.com"&gt;&lt;font face="Tahoma" size="2"&gt;Travel Home Working&lt;/font&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.travelcounsellors.com"&gt;&lt;font face="Tahoma" size="2"&gt;Travel Counsellors&lt;/font&gt;&lt;/a&gt;&lt;font face="Tahoma" size="2"&gt;&lt;br /&gt;&lt;a href="http://www.recruitmentcounsellors.com"&gt;Recruitment Counsellors&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8444" width="1" height="1"&gt;</content><author><name>Mr Pike</name><uri>http://weblogs.asp.net/members/Mr-Pike.aspx</uri></author><category term="Search Engine Miscellanea" scheme="http://weblogs.asp.net/dbarrow/archive/tags/Search+Engine+Miscellanea/default.aspx" /></entry></feed>