Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Thursday, May 11, 2006
A simple programmers blog
 
# Thursday, May 11, 2006
I've seen a couple of posts recently (Nigel & Xtramalt) regarding advertising and Microsoft's move into this market.  I'm not sure how long this has been going on or exactly where it is going, but I'm worried, VERY worried.  In particular, I'm worried about unsolicited advertising appearing on my own or kids desktops.  It's bad enough that subliminal advertising is so prevelant in TV programs (including News), Movies and Games.  The 8 hours (or more) I spend in front of a PC screen is the one place I am isolated from the marketing persons lies and brain washing.
 
Let me state now that if Microsoft intends to deliver advertising to my Vista desktop then I wont be using Vista.  In fact, I'd be inclined to not use Windows at all - given that I hate Linux that only leaves Mac or a change in career.  I might move into the PC demolision business.
 
Can someone please tell me that I'm unduely worried about this possible future?
 
Hmmm, does having a few Google ad's on my web site make me a hypocrit?
 
UpdateDarryl & Nigel have assured me that I am worried about nothing - it's just my over eager paranoia at work! Phew.  You have to keep a very watchful eye on these marketing people tho :}
Thursday, May 11, 2006 10:54:09 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 
I've been getting a lot of spam at work lately that is getting through our normally very efficient filter.  It gets through because the senders address 'looks' valid, isn't black listed and the content of the email is a single jpg.  For the spammer this is not so great because they can't put hyper links in the message so even if I was inclined to read the drivel they promote then I'd have to manually navigate to some stupid web site.  I'd be very annoyed if I was paying for these emails to go out.
 
However, the real issues is how to block these.  The simple answer is to use gray-listing - not sure if this is the correct name but this is what my wife does - I think it goes something like this:
  • Email is received.  Receiving server check's it's white-list of senders and finds that the email address is unknown.
  • Receiving server pings the senders domain email server and asks it to verify the address.
  • If the senders server doesn't respond at all then it's most likely spam and email is gray-listed
  • If the senders server responds with an OK response then the email is let through - at least to the next level of checkinig.
  • If the senders server responds with an error or BAD then the email if gray-listed or blocked.
Users are able to view gray-listed messages and unblock senders or whole domains.
 
This sounds very simple and logical but it's very suprising how few ISP's do this. Despite the advertising campaign Telecom don't do spam checking of any consequence.  My wife used to use Xtra but when she found out that they will allow through emails from non-existant Xtra accounts that didn't come from one of there own servers, well this was the last straw I think.
 
For my personal email I have my own server on my hosted domain.  It uses spam assassin which does a reasonable job - I get about 5 on a bad day.  What's your ISP like? 
Thursday, May 11, 2006 9:23:25 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Tuesday, May 09, 2006
I've spent about a day and a half creating a MSI to install my project using Wix.  I wanted to use Wix because the MSI has to be built during my build process automatically.  After a confused start I now have a working installer that:
  • Displays a nice splash page
  • Displays a license agreement with a checkbox for confirmation
  • Checks for minimum OS version and .Net 2 Fx
  • Lets the user choose a Typical, Custom or Complete install.  Under custom they can choose Client and/or server components and specify directories for each.
  • Prompts the user to enter config parameters for the client and server and updates the corresponding exe.config and web.config files
  • If the server components are installed it creates a virtual directory in IIS
The next step is to add an option to create the SQL database but given my progress so far I don't expect this will be too hard. Then I need to figure out how to send out patch installs - I suspect this might be a tad harder.
 
Along the way I've discovered a few things about Wix so here's a list of stuff that might help others (and probably myself when I've forgotten this in a few weeks time :).
  • Use the v 2 latest revision.  I used 2.0.4103.0.  Get the source code and binaries - you'll need the source to create custom dialogs.
  • Use the Tutorial.  It's a bit vague in places but just hack something together and you can usually figure out the options.
  • Google 'wix anything' and you will find an answer quickly.
  • Join the wix-user mail list.  The chaps there are very helpful and friendly.
  • Creating a custom dialog is a piece of cake if you follow the tutorial but a GUI tool to create the dialog layouts would be nice.  Maybe there is one ?
  • There is a Visual Studio addin for Wix projects but I had problems with this - maybe my fault - so I just used the tried and true command line method and Visual Studio to edit the raw wxs files.  You should add the provided schemas to your VS schema directory and create a CMD or BAT file to compile and link your MSI.
  • Updating config / xml files from Wix is easy but you have to escape the xpath expression correctly, e.g.: 

    ElementPath="/configuration/applicationSettings/Airways.SUMS.Properties.Settings/setting[\[]@name='FirstDayOfWeek'[\]]/value"

  •  The syntax can be a little wordy in places but in general it all makes sense.  A ComboBox control in a custom dialog looks like this:

    <Control Id="FirstDay" Type="ComboBox" X="115" Y="70" Width="190" Height="15" TabSkip="no" Property="CC FIRSTDAYOFWEEK" ComboList="yes" Sorted="yes">
     <
    ComboBox Property="CC FIRSTDAYOFWEEK"
    >
      <
    ListItem Text="Sunday" Value="0"
    />
      <
    ListItem Text="Monday" Value="1"
    />
      <
    ListItem Text="Tuesday" Value="2"
    />
      <
    ListItem Text="Wednesday" Value="3"
    />
      <
    ListItem Text="Thursday" Value="4"
    />
      <
    ListItem Text="Friday" Value="5"
    />
      <
    ListItem Text="Saturday" Value="6"
    />
     </
    ComboBox
    >
    </
    Control>

  • You can edit the supplied Bitmaps to include your product or company logo.  In fact you can customise everything.
So, I don't know how this compares with InstallShield, Wise etc but I'm quite taken with Wix and I found it quite fun to use.  I'm certainly no expert on installers and MSI's but I've managed to create a slick installer with minimal effort.  Most importantly, Wix passes my 20 minute rule:  I have to be able to produce something useful in 20 minutes or it's no good for me.
 
Tell me what you think.
Tuesday, May 09, 2006 3:34:05 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   General  | 
# Friday, May 05, 2006
It's getting on for 2 months since TFS was released and I still haven't upgraded from RC to RTM.  Why?  Well several reasons really: time & budget (or lack of it) but mostly because I still can't get it.
 
Our only option, AFAIK, is to get it via Volume Licensing and it is only just becoming available this month - not sure exactly when but I've only this week managed to get local pricing (which thankfully was about half what I thought it would be :).  Considering that it was released in mid March and that the Workgroup and Trial versions have been available since then, I really don't understand why it has taken sooooo long.  Perhaps someone has explained why but I never saw it.
Friday, May 05, 2006 9:10:14 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   Team System  | 
# Thursday, May 04, 2006
I've been signing my project assemblies this week and today when I ran my Team Build, it failed with the following error:
 
    error MSB3323: Unable to find manifest signing certificate in the certificate store
 
It turns out that this is caused by a bug in Visual Studio or Team Build or MSBuild - take your pick.  If you ever turn on signing of Click Once Manifests in your project properties, the project file gets updated.  Turning off the setting does not completely remove everything it should remove - at least, not as far as MSBuild is concerned.  The solution is to manually edit the csproj or vbproj file and remove some settings.  For a full disclosure of the fix, read the forums thread.
Thursday, May 04, 2006 1:34:37 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Wednesday, May 03, 2006
I've spent a lot of time lately - far too much in fact - getting DotNetNuke 4 setup for module development.  On the face of it, it seems very simple - install the start kit, create a DNN project and press F5 - but that will only give you grief. 
 
For future reference, the most useful thing you can read is this post by Shaun Walker. Follow the instructions there EXACTLY!  If you can't be bothered then here is my shortcut version:
  1. Download and install the DNN 4 Starter Kit.
  2. Create a VB Web Site project in VS05 (Express or other) and select the DNN Project.
  3. You MUST specify and HTTP web site - don't use FILE - Cassini is not up to it.
  4. Add the new database.mdf to the App Data directory (or create on elsewhere and change the config files connection string).
  5. Give Network Service or ASPNET Modify rights on the new web site folder.
  6. Rename release.config to web.config.
  7. Run
If you follow all of these steps you shouldn't have any problems.
 
Other tips:
  • Don't create modules in C#.  You are supposed to be able to and I did manage to create one once, but the 2nd time around it gave me all sort of stupid errors.  Just accept that DNN is VB and your modules should also be VB.  (It's not that bad really :)
  • Use SQL Express if you can.  The integration with VS05 is fantastic.
  • Make sure you have a decent machine to develop on.  My notebook is a 3 gig P4 but it only have 500mb RAM and VS05 grinds like a meat mincer full of concrete.
 
 
Wednesday, May 03, 2006 9:36:10 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   General  | 
# Tuesday, May 02, 2006

Rod just blogged that ERWin was recently (?) purchased by CA.  What a shame!  I never actually used ERWin in anger - I'm a code first, diagram later kind of guy - but it looked good. 

Does anyone remember Nantucket Clipper?  In the late 80's and early 90's it was THE database development language for DOS (a lot of FoxPro users may be laughing about now).  Nantucket created some wonderous stuff that we have only recently seen in Windows tools - things like code blocks,eg:

    LOCAL block := {|var1, var2| DoSomething(var1, var2) }
    LOCAL res
    res := ExecThing(block)

    ? res

    FUNCTION ExecThing(block)
      LOCAL v1 := 1, v2 := 2
      return eval(block, v1,v2)

    FUNCTION DoSomething(x,y)
      return x + y

It also included the best preprocessor I have ever seen, you could create user define statements to the extent that you could create your own language.  Very cool and very dnagerous.  I once heard someone describe Clipper 87 as a tool that let you shoot yourself in the foot and Clipper 5 as a tool that would let you shoot yourself in any part of the body you wanted. 

Anyway, Clipper still lives on - I have one customer that I still support with 12 year old code.

But I digress.  CA purchased Nantucket not long before they were due to release the long awaited Windows version of Clipper.  And that was about it.  CA did ship Visual Objects and a small upgrade for Clipper 5 but essentially CA killed it. 

So, if you like ERWin, then be warned.

Tuesday, May 02, 2006 8:35:02 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   General  | 
# Monday, May 01, 2006

Here's the code for the tasks from my Team Build pressie at Code Camp.  JonesieMSBuildTasks.zip (7.64 KB)

There's 4 custom tasks in the zip.

  • CreateVDir: Create a Virtual Directory in IIS.
  • ModifyXMLNode: Modify an element or attribute in an XML (.config) file.
  • AddListItem: Add an item to a sharepoint list.
  • ExecuteSQL: Execute some SQL.

If you find any bugs or make some enhancements then please send then to me and I'll incorporate the changes for all.

And here's the references from the slide deck.

TS Home:   http://tinyurl.com/n5zf5
TN_1600:   http://tinyurl.com/mxqpj  The TechNote detailing how to alter you SLN files.
TF Blog:   http://tinyurl.com/ryp52
MSBuild Blog:  http://tinyurl.com/pv9z9
ScottGu:   http://tinyurl.com/syjcw 
Forums:   http://tinyurl.com/n8shm

Monday, May 01, 2006 3:51:00 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   NZ .Net User Group | Team System  | 
# Saturday, April 29, 2006
Doh! DNN Template by peter@jonesie.net.nz
I've had several attempts at creating a new DotNetNuke web site on my local machine.  Thoughtfully, DNN 4 comes with a template project for doing this but for the life of me I couldn't find it when I created a new Web Project.  I spent hours trying to find a solution to what I thought was a broken Visual Studio installation and today I was going to re-install VS to fix the problem.
 
We'll this morning I had a brain wave (to make up fo the brain farts) and realised that DNN is a VB project so now when select Visual Basic in the new web site dialog I can see the DNN project template and it works.
 
Double Doh!  I seem to be able to think straighter lately.... a bit.
 
Saturday, April 29, 2006 8:42:45 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   Visual Studio  | 
# Thursday, April 27, 2006
I was tired of my old Dilbert desktop today so went searching for a snazzy new image.  In the process I found a blog post to few sites with some lovely images that work well on dual monitors.  I remembered that UltraMon allows you to span an image across two monitors or have different images on each.  I downloaded and installed it and now I wish I had tried it out a long time ago.  If you have dual monitors you must get UltraMon.
 
One of the sites I browsed tells me that IE Sux and I should use FireFox.  There is no way of browsing the site at all with IE.  To the the owner of http://www.guikit.com I'd like to say that if you believe that 75% of the world is wrong then go ahead and block your site, I don't give a rats.  Everyone is entitled to thier opinion and you may well be correct but it's like saying that people who drive on the right hand side of the road are wrong and I'm going to drive on the left no matter where in the world I drive.
 
Then I discovered the brilliantly named site http://www.killbillsbrowser.com.  How f'ing ridiculous can you get?  OMG, get a life.  What about all the corporate users who don't have a choice?  I've seen this sort of campaign before - from OS/2 users, from BetaMax fans .  Didn't work then, won't work now.  FireFox is a great browser and IE 6 does have it's problems (to put it mildly :) but this sort of religious clap trap doesn't make anyone want to change.  Just get over it!
 
Phew.  That feels better.
Thursday, April 27, 2006 2:19:27 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 
# Wednesday, April 26, 2006
A few people have had some negative things to say about Microsoft Live & Vista of late.  While I'm certainly no expert on either of these I'd just like to offer my observations.
 
Live is a google killer.  From what I have seen so far, and from past experience, Microsoft will have a superior product based on one thing: Integration.  No one does integration as well as Microsoft.  Google is currently all over the place.  Some things looks the same, some things work the same, but in general it's 'messy' :}
 
Sure, Live is very messy also but it's not even v1 yet.  When the integration with Vista is working and Live is more Live, I think people might be less harsh.
 
HOWEVER, I don't like Live either and its not becuase it's buggy or evil, but becuase I've seen web portals before and adding a splash of Ajax is not going to spin my wheels.  PORTALS JUST DON'T WORK.  This whole Web 2.0 Mashup BS is just that - complete marking hype.  Give it a year or two and we won't be any further ahead than we are now.
 
I beleive that Microsoft have a grander vision than Live and I think it is this:  "The web does not work.  Smart client applications are where it is at.  Let's create a medium that will leverage both platforms and drive people back to Windows - but with an open implementation that will encourage development and adoption". 
 
If I had my way I'd make HTML & JavaScript illegal.  Sure it has it's place but everything in Web 2.0 is just a catchup to what Smart Client apps (or whatever you want to call them) have been doing for years.
 
As for Vista, that's a different story.  Most people haven't seen the real power of Vista yet - and it's not anything you can see through the glass UI.  The best parts of Vista are under the hood.  I remember a lot of similar statements about XP 3 (?) years ago but look at it today - it's the domenant desktop UI by a huge margin.
 
I may be completely wrong on all of this - I often am - but one thing is certain - we love change.  Sooner or later we will embrace it in one form or another.

Wednesday, April 26, 2006 4:43:21 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
As you've probably seen elsewhere our Code Camp is done for 2006 and yes, it was a great success. I've been collating the eval sheets and we got a very high average score on presentations, speakers & venue.  I think the only thing really missed was some sort of social event.  You can bet that it will be on the agenda for the next Code Camp, but this year there just wasn't time to do everything.
 
When we started the initial planning for Code Camp, I estimated that 80 people would be a good size audience.  In the end we had 150 registrations and of these about 20 no-shows.  For most of Saturday there was in excess of 110 people in the main room.
 
Some people would like to have another Code Camp this year, but it's taken me three days of rest to regain some level of equilibrium so I'm not yet ready to think about that. 
 
While I didn't have a lot of time to sit and absorb the presentations the highlights for me:
 
Rod, Chris and Mauricio's Business Forum
They had some great tips and background info for budding entrepreneurs.  If I was younger and riskier I would be very inspired to have a go.  Sadly, I'm too old and stayed in my ways for that sort of malarky.
 
Ivan on WPF
Ivan was a great presenter and gave a good overview of WPF with plenty of wizzie demos.  I'm sure Kirk will be calling on him again to present.
 
Tim on Ajax
I think this was Tim's biggest audience but despite a few nerves he did a great demo of Ajax & Anthem.  He made me wish I was doing web stuff. 
 
And all the other presenters were great too - but some required more brain cells than I had to spare over the weekend.  That's the big problem with running these type of events - you miss out on most of the good stuff.  Oh well, maybe next year.
 
Wednesday, April 26, 2006 4:25:20 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Thursday, April 20, 2006
This is my favourite report from Team System.
 
 
Can you see when I started to get some help with the project?
Thursday, April 20, 2006 7:50:11 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   Team System  | 
# Monday, April 17, 2006
Code Camper's are Go! by peter@jonesie.net.nz
5 Days till Code Camp!  I can't wait.
 
When I first thought about organising a community lead developer-only event I realised it would be a lot of work and I wasn't wrong.  However, it's been a lot more work for everyone else than me.  So before things get crazy, I'd just like to publically thank The Team - Kirk, Sue, Brenda, Tim, Chris, Nic, Phil, all the presenters and everyone else who contributed some time or ideas to this project.  Now we just need to make the event happen.  See you all soon.
 
Monday, April 17, 2006 8:26:21 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
I was just catching up on my long overdue blog reading and saw on ScottGu's blog that MS have released the source for all (?) the ASP.Net 2 providers.  This is awesome!  If you want to create your own providers then this will be a fantastic resource to help you do it 'The Microsoft Way'.
 
It would be great if they extended this philosophy to more of the Framework.  Borland used to do this with the Delphi VCL.  I never actually used any of the VCL code but on occasion it was necessary to delve into it to figure out why something worked the way it did.  Usually this was because of some strange control behavior rather than a core runtime feature.  Microsoft do have shared source agreements on other products - most notably Windows (2K & 2K3?) and Rotor but you have to jump through flaming hoops to get it. 
 
Publicly releasing the code for ALL the ASP.Net and WinForms controls would not provide any competitors with an advantage.  There are plenty of public licenses around that would protect Microsoft from litigation or MS Legal could come up with something in their spare time.  It would not encourage many developers to copy and enhance the standard controls.  It would, however, provide a wealth of knowledge to developers that would allow them to understand why the .Net World is round and not flat. 
 
Clearly, the Open Source movement has had some effect on Microsoft.  Over the last few years - in fact ever since Steve Ballmer took over - Microsoft have been much more open - and not just in the source code kind of way.  I'm sure this debate has not ever gone away and I'm also sure they are constantly being asked the same question but I've never heard a reason from Microsoft that explains why they cannot open source more products.  I'm guessing many at Microsoft are also thinking the same thing.
Monday, April 17, 2006 8:08:34 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Tuesday, April 11, 2006
I've had enough.  Time for a rant.
 
Why is our state television broadcaster being allowed to waste money on digital television?  Do they really think this will improve the quality of anything but the signal?  Digital crap is about as usful as Analog crap.  Before I shell out good money for a decoder I'd want to know that the quality of the programming was similarly upgraded and the advertising considerably reduced.
 
Best theory: Kill your TV - or at least, kill your antenna.
 
And what about the price of new TV's here?  How can anyone justify spending $5k on a wide screen plasma or lcd TV?  It's such a con.  Wake up people - vote with your wallets.  Better yet, get outside and enjoy life while you can - before Bush kills us all.
 
Ok, sorry, bad morning, back to work.
Tuesday, April 11, 2006 9:15:28 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 
# Wednesday, April 05, 2006
MVP's Awarded by peter@jonesie.net.nz
ASP.Net Guru and mate Tim has just been awarded an MVP.  Well done Tim, you thoroughly deserve it.  Oh yes, I was also re-awarded this year, for which I am extremely grateful because next March the Global MVP Summit will be keynoted by the man himself - Bill Gates. Steve Ballmer did last years so it will be great to see the 'other' half of the dynamic duo!  Hopefully, you'll be able to make it Tim.
Wednesday, April 05, 2006 7:17:52 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Monday, March 20, 2006
It's been a long time coming but Team Foundation Server has finally shipped.  I'd just like to say a big Thank You to the team at Microsoft for a job well done.  Your stellar efforts have resulted in an outstanding product that can only get better.  The amount of support from 3rd parties and the community is a great vote of confidence in the product and I'm sure we will be seeing some very interesting improvements and additions in the next version - which will ship next month, right? :}
Monday, March 20, 2006 8:49:38 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   Team System  | 
# Wednesday, March 15, 2006
I spent a couple of hours in Wellington and Auckland this week with Michael Leworthy - ex(?) TFS PM and Australian larrikin - and Jeremy Boyd - RD & Kiwi larrikin - doing a real-short presentation to the Architects Forum on my experience with Team System.  Along the way Michael presented a few tid-bits of news and some nifty things you can do with TFS.
  • Launch of Team System is March 16 in the US.  RTM will follow very shortly after this.  Michael wouldn't give us a date - even off the record - but I'm guessing you can start looking for a download about the end of next week.
  • In April (I think) there will be a truck load of training material for TS released on the web site - 150 videos, labs, white papers etc. 
  • In June, at TechEd US they will release the timeline for TS 2 and also the way that future version of the individual roles of Team Suite will be release.  Currently all edition are released together but this may change.  There's also some other big announcement scheduled at the same time but again, Michael could not be bribed or threatened into revealing the details of this.
  • They are looking at producing new roles such as an edition for DBA's and database designers.
  • Michael did a nifty demo of using Workflow Foundation to trigger some Team Build activities.  It's quite trivial to hook into TFS events to fire off a workflow.  I thought this was a great idea and can't wait to put this to use.
  • Michael also has a MSN style popup message that fired off when a TFS build event happened.  The code for this will be posted shortly.
Fun times ahead!
Wednesday, March 15, 2006 4:02:35 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   Team System  | 
# Tuesday, March 07, 2006
I just created a new stored proc using SQL Management Studio (can I call this SMS?) and discovered the cool new templates you get for free.  The standard template for a new proc looks like this. 

    1 -- ================================================

    2 -- Template generated from Template Explorer using:

    3 -- Create Procedure (New Menu).SQL

    4 --

    5 -- Use the Specify Values for Template Parameters

    6 -- command (Ctrl-Shift-M) to fill in the parameter

    7 -- values below.

    8 --

    9 -- This block of comments will not be included in

   10 -- the definition of the procedure.

   11 -- ================================================

   12 SET ANSI NULLS ON

   13 GO

   14 SET QUOTED IDENTIFIER ON

   15 GO

   16 -- =============================================

   17 -- Author:    <Author,,Name>

   18 -- Create date: <Create Date,,>

   19 -- Description:  <Description,,>

   20 -- =============================================

   21 CREATE PROCEDURE <Procedure Name, sysname, ProcedureName>

   22   -- Add the parameters for the stored procedure here

   23   <@Param1, sysname, @p1> <Datatype For Param1, , int> = <Default Value For Param1, , 0>,

   24   <@Param2, sysname, @p2> <Datatype For Param2, , int> = <Default Value For Param2, , 0>

   25 AS

   26 BEGIN

   27   -- SET NOCOUNT ON added to prevent extra result sets from

   28   -- interfering with SELECT statements.

   29   SET NOCOUNT ON;

   30 

   31     -- Insert statements for procedure here

   32   SELECT <@Param1, sysname, @p1>, <@Param2, sysname, @p2>

   33 END

   34 GO

 
Like the comment says, you can specify values for the placeholders by pressing Ctrl+Shift+M:
 
 
 
You can view and edit all the templates - and there's a lot of them - by using the Template Explorer from the View menu:
 
 
This is not as cool as CodeSmith, but it's free and easy and very cool.  Remember, you can use Management Studio with SQL 2K, not just 2005.
Tuesday, March 07, 2006 10:16:37 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | SQL  | 
# Friday, March 03, 2006
My old Jonsie.net domain is due to expire sometime soon so I thought it was about time I saved the 1 or 2 interesting posts I made there. The old site uses .Text so I could easily grab the posts from the SQL DB, but I thought it would be more fun to use RSS.  I remember Scott Guthry posting recently about the ASP.Net RSS Toolkit so I downloaded it to have a play.
 
First thing I tried was to RTFM but for some reason this word doc keeps exploding and taking Word with it.  A quick copy and paste to a new document fixed that (Word's document recovery was less than helpful!).  The 'manual' is a little sparse, but it gives enough pointers to get your started.
 
There are several ways you can access the RSS feed.  I wanted to create a simple WinForms or Console app to do this job so I tried using the Rssdl.exe tool to create a strongly typed channel feed.  Unfortunately our Nazi firewall got in the way and the RssToolkit doesn't know anything about firewalls.  After a bit of a search around the code I found the source of the problem in RssDownloadManager.DownloadChannelDom().  It was using WebClient to make the call to DownloadData but without first configuring the proxy.  So, I changed this to:
 

    1             // download the feed

    2             WebClient wc = new WebClient();

    3             wc.Proxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;

    4             byte[] feed = wc.DownloadData(url);

 

This is adequate for this UI application but for a more robust solution you may need to modify this to allow a user name, password and proxy string to be passed in somehow. 

 

So, now I executed the Rssdl.exe too to create the class. This created jonsie.cs for me.  I then created a simple console app to dump the title of all the items on the blog:

 

    1 using System;

    2 using System.Collections.Generic;

    3 using System.Text;

    4 

    5 using RssToolkit;

    6 

    7 namespace JonsieExtract

    8 {

    9   class Program

   10   {

   11     static void Main(string[] args)

   12     {

   13       jonsieChannel jc = jonsieChannel.LoadChannel();   

   14 

   15       foreach (jonsieItem ji in jc.Items)

   16       {

   17         Console.WriteLine(ji.Title);

   18       }

   19       Console.ReadLine();

   20 

   21     }

   22   }

   23 }

 

Which produced this:

 

 

Cool!  Oh, crap.  I only get the last 15 posts.  I need all of them.  Oh yeah, this is a setting in .Text.  So I log to my old site and .. hang on, where's the admin options?

 

 

IE 7 has problems displaying the tabs.  Fortunatly I have a spare machine with IE6.  I set the Default number of posts on the home page/feed to 115 and click save.  And wait.  And wait. And wait.  Bum.  Looks like .Text is as useful as ever.  Oh well, part 2 another day.

Friday, March 03, 2006 3:36:01 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
# Tuesday, February 28, 2006
I've been tweaking a stored proc today and when using the new SQL 2005 Management Studio I spotted a new option in the query menu:  Client Stats.  When I execute the stored proc, I get a tab page with some interesting numbers.  The really usful thing is, if I execute the same query again - after tweaking the proc - I get to see multiple results side by side:
 
 
How cool is that!
Tuesday, February 28, 2006 2:57:27 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | SQL  | 
# Monday, February 27, 2006
Plans are starting to come together for our Code Camp. There's a lot of work getting this organised, but it's starting to get exciting.  So far we have about a dozen sessions and speakers confirmed, talking on some interesting topics like AJAX, Ruby on Rails, WWF, SQL, Biztalk, Team System and more.
 
Registration for Code Camp will - hopefully - be available this week.  In the meantime, you can enjoy the chrome, created by Phil (The Genius) Cockfield.

 

Don't miss the great kiwi
Coding Getaway

Two days of hard core .Net programming demo's, workshops & discussions. Nothing but code.

Code Camp 2006, April 22/23,
Porirua Wellington


Brought to you by the NZ .Net User Group
Monday, February 27, 2006 4:18:17 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | NZ .Net User Group  | 
# Friday, February 24, 2006
I've started working though the Hands-On-Labs for Windows Workflow Foundation today and in Lab 1, Excerise 1 (more about that later) I discovered something old that I had never existed before:  Event Accessors. 
 
Normally you would decalre an event like this:
 

    1 public event EventHandler<CancelEventArgs> ValidateControls;

 

 

Using Event Accessors makes this look a lot more like a property:

 

    1     public event EventHandler<CancelEventArgs> ValidateControls

    2     {

    3       add

    4       {

    5 

    6       }

    7       remove

    8       {

    9 

   10       }

   11     }

 

This could be useful to ... hmmm, I'm not exactly sure if I would use it, but I imagine some people would.

 

FYI, this also works in .Net 1.1.  Not sure about VB though.

Friday, February 24, 2006 8:59:21 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
# Thursday, February 23, 2006
I just noticed that Visual Studio gives you a nice little tooltip in the Solution Explorer to tell you who has a file checked out (or not).
 
 
Is this new?  I normally don't keep the mouse stationary long enough to see tooltips.
Thursday, February 23, 2006 1:24:03 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]   Visual Studio  | 
Copyright © 2010 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: