Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - Tuesday, August 30, 2005
A simple programmers blog
 
# Wednesday, August 31, 2005
AzMan by peter@jonesie.net.nz
This is why you go to TechEd.
 
I just did a session on ASP.Net Roles and Membership stuff.  Sam Spencer was taking about providers for Roles and mentioned AzMan - Authorization Manager.  It turns out this has been around for a little while now.  It works on 2003 & 2000 Server and even XP and gives you a way of storeing and managing application user roles in your own applications. 
 
Geeze I wish I new about this a year ago.  There's a good blog post here.
Wednesday, August 31, 2005 10:25:40 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]    | 
dasBlog email posting by peter@jonesie.net.nz
Yay!  I can post to dasBlog using email.  It works really well. I can now use Outlook to compose posts so expect images and better spelling in future posts.
 
 
See, it worx!
Wednesday, August 31, 2005 8:03:00 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]    | 
The second day of TechEd was just as good as the first - but longer.  I'm going to need a brain vacation by the end of Wednesday. 
 
Sessions
One of my favorite speakers and all-round nice guy Adam Cogan presented 15 Rules for better code.  Here's a great quote from Adam:
 
"Code never rusts"
 
Which means, don't re-write for the sake of it.  I should print this in a large font and stick it to my desk! This was the best session so far for me.  Adam is never afraid of expressing his opinion which is quite refreshing.  Some of his ideas are unconventional but actually make a lot of sense - like including menu options so customers can execute unit tests in shipped applications. 
 
I'm definitely going to get a copy of his Code Auditor.  It's like FxCop in some ways but it runs on the source code and you can look for things like correct Font usage, button size, form styles etc. [Adam - next time you want to do a session in Christchurch you can do any subject you like].
 
Fellow NZ.Netter Chris Auld presented an interesting session on Office Solutions.  I didn't realize there were so many ways of interacting with Office and Office data files.  It's quite a mess really.  Hopefully things will improve with VSTO 2005.  It did give me an idea on how I could re-write an application using InfoPath and a custom Task Pane - but then I'd be breaking my new "Code never rusts" mantra.
 
Jay Roxe presented another great session on ClickOnce deployment.  He did lots of demos of the basic stuff we have all(?) seen before but he also answered lots of great questions and talked about how to extend ClickOnce using the System.Deployment namespace and Mageui.exe.  I do like ClickOnce and it provides some great features over NoTouch deployment, but I'm not exactly sure how to use it when delivering applications off-site.  At work, we don't create shrink wrapped solutions - they need us to install and configure - but we do need to be able to deliver updates in a way that anyone can install them.  I was hoping I could do this with ClickOnce but essentially I need ClickOnce to deliver a ClickOnce deployment.  Jay asked my to email the details to him which I will do once I'm back at work.
 
Ulrich Roxburg did a good overview of the SOA designers in Team System Architect Edition, and showed some new stuff I hadn't seen before (and I'm not talking about the 4398 error messages!). There's a new tool, Narrator, that give you an interactive view of your model. I found a MSDN Download for this, I think.
 
To finish the sessions for the day, I attended Nic Wise's session on Mobilising Smart Client Apps.  This was a great nuts and bolts session on using a low level API (the name of which has slipped my mind) to detect network status changes and other information.  I can see myself using this in normally connected desktop apps.
 
The Party
Normally, the idea of party with hundreds of geeks would be a frightening prospect.  But throw in copious quantities of alcoholic beverages, loud music and degenerate comedians and you get a great event.  This year TechFest was at the St. James theatre.  I hadn't been there before and it was certainly an interesting venue, if a little cramped at times.  Ewen Gilmore gave 3 routines that had me in stitches at times - he's certainly not for those that are easily offended.  Then the Feelers rounded off the night.  I snuck off early to bed so I could get up and blog this.  I expect to see quite a few red eyes this morning.
 
I have a few photos from the session but for some reason I can't get the memory sticks to work in my notebook.  I also noticed my wireless lan card has an interesting curve in it.  Time for a service I think.
 
More tomorrow.
Wednesday, August 31, 2005 7:51:48 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Tuesday, August 30, 2005

Day 1 went fairly smoothly at TechEd.  A few of the sessions were jammed so had to be repeated at the end of the day - JB's SQL session in particular.

The food is excellent, the venue is ok and doesn't seem to packed.  A couple of the rooms - particularly at the Crown Plaza could do with some more oxygen - especially after lunch!  I noticed a few nodding heads at one session (including my own).

Keynote

Ross Peat (MS MD NZ) introduced the day and did the usual speel.  He did announce a new incubator sponsorship for 100 small companies of $NZ 3.5M. 

Ian McDonald and friends did a quick overview of new stuff coming soon - SQL05, VS05 yada yada.

The best thing about the keynote?  It was short.  Only 1 hour.  I much prefer this format - no glitz or glam, just the facts.

Sessions

I had planned to attend a lot of Architecture sessions and I did the first one on Team System with Michael Leworthy on internals and configuration.  Michael certainly knows his stuff - as you would hope - and the session gave me a bit more confidence to fiddle with methodology schemas.  There will be a new tool available at RTM to make this easier but at the moment it's notepad.

Michael was also using a later release of VSTS than Beta 2.  Some of the new stuff may be in the the last CTP (June/July?) which I'm note yet using.  I particularly like the new Team Build output page.  This is a big improvement over Beta 2.

I also went to the start of the second TFS session presented by Prashant Sridaran but left after 10 minutes.  It was an overview of VSTS which I have seen a million times already - bad choice.

I then attended a session on Windows Communication Foundation (Indigo) with Ari Bixhorn.  Ari is a great speaker and is always very popular.  Indigo is something I know I will use but I've been avoiding it as much as possible as I know it will be a big distraction.  However, a couple of my colleagues also attended this session and are very keen to do something with it so it looks like I'll probably make the leap and risk a few more bleeding edge wounds.  For my next project...

I also did a session on ASP.Net Themes, Master Pages etc.  I've seen some of this before but the demos were excellent and glued the whole thing together very well.

People

The best part of TechEd is always all the interesting people you meet.  So far I've bumped into (shamless name dropping in no particular order) Alex James, Dave Dunstan, Brent Clark, Greg Low, Adam Cogan, Rod Drury (and yes, I tried the Segway), Nic Wise, Chris Auld, Kirk Jackson, Kurt Mudford, Lukas Svoboda... um, probably lots of others I can't recall right now.

Tuesday is party day so I'll try and pace myself, but don't expect a great post afterwards.

 

Tuesday, August 30, 2005 8:52:46 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 

I've been trying to use different tools to post to this blog.  Others have reccommended BlogJet, which I have tried on 2 machines at work (and get Access Violations or proxy problems) and my notebook.

It works fine from my notebook but I really want to be able to post images and BlogJet uses FTP to do this.  Problem is, it always tries to create the directory and can't.  It won't seem to use an existing directory.

Has anyone else got this working with dasBlog or can reccommend something else that works?  I don't mind paying (unusual for me!)

Tuesday, August 30, 2005 8:19:48 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 

I've upgraded to dasBlog 1.8.  Wasn't too painful and it seems to be working well enough.  Not exactly sure what has changed yet but it hasn't fixed one small bug I have.  When I click Add Entry, I always get an error on the first click and it always works the second time.

Tuesday, August 30, 2005 8:16:47 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Saturday, August 27, 2005

I've been very slack with my posting lately but hopefully that will all change next week.  I'm off to Auckland tommorow for TechEd on Monday and I hope to be able to post details of the sessions I'm attending as often as possible - or at least a summary at the end of each day.

I don't have to earn my keep this year  so I'll be doing as many sessions as I can handle.  I've picked mostly Architecture sessions but also a few developer sessions.  I'm particularly interested in Team System (surprise surprise!), SQL 05 and Indigo.

If you happen to be attending too then make sure you pop into the MSDN Connection Lounge and say hi.  I'll be there as often as I can, along with fellow NZ .Netters such as Kurt, Kirk, Chris, Nic and others.

Saturday, August 27, 2005 11:50:07 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Friday, August 26, 2005

I don't like politicians.  Especially at election time. My normal approach is that, within reason, it makes f-all difference who is in power so vote as irrationally/emotionally as you like - you get screwed either way. 

However, after looking www.taxcuts.co.nz, I figure I'd be $10k a year better off with National than Labour.

Flip-flop-Don is not such a bad chap really - he's just a little indecisive.  But aren't we all?

Friday, August 26, 2005 1:34:26 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Wednesday, August 24, 2005

I'm using the new ToolStrip and ToolStripContainer in our VS05 application and it looks hot!  However, I've had a lot of trouble getting the toolstips to behave and stay where I want them in design mode.

This morning I discovered that using the Document Outline works really well for moving stuff around on your winforms.  Now it all looks sweet.

Wednesday, August 24, 2005 8:34:02 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [3]   Visual Studio  | 
# Friday, August 12, 2005
A word of warning.  In VS 05, if you REMOVE a project from a solution, it actually get's deleted from disk and Team System Source Control.  Thank [insert your devine being here] for Undo Pending Changes!
Friday, August 12, 2005 8:51:33 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   Team System | Visual Studio  | 
# Tuesday, August 09, 2005

The NZ .Net User Groups have launched a competition for the Blog of the Year.  See details here:  http://www.dot.net.nz/Default.aspx?tabid=78.  But, you can't vote for me - that would be dodgy - as I'm counting the votes!

Update: Voting is going pretty well - there was close to 400 votes last night, but only 150 unique votes - hitting the vote link 77 times in a row is sort of obivous!

Tuesday, August 09, 2005 9:27:21 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Friday, August 05, 2005

This is one of those Friday afternoon problems.

In my 2005 Winforms client I have a nice fancy splash screen that displays the current version - 3.0.0.0 (yes, this is the 3rd version but the 1st .Net version) - which it retrieves from Application.ProductVersion.  Under the covers, ProductVersion is actually just AssemblyFileVersion from assemblyinfo.vb/cs.

Now, I wanted to have this auto increment the build number.  In VS03, you do something like this: [assembly: AssemblyFileVersion("3.0.0.*")] and the asterix is replaced with the next version on each build.  Well this didn't work.  All I got was "Version 3.0.0.*" in the splash screen.

Ok, fair enough, probably a beta issue or there is another way of doing it I'm not aware of.

HOWEVER, when I tried to exit the app, it crashed trying to save Properties.Settings.Default.  It said there was an invalid character in the file path.  Of course, there was an hour between these two issues so it took me a few minutes but eventually I figured that the version number is used in the settings file name.  Removing the asterix solved this problem.

FYI

Friday, August 05, 2005 4:08:43 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General | Visual Studio  | 
# Wednesday, August 03, 2005

I don't want to burst anyones bubble here, but I think there's a lot of people under the impression that SQL 05 & VS 05 are going to be released on November 7th.  From everything I've seen announced, this is the LAUNCH date, not the RELEASE date - they could be quite seperate things.  At the very least, I wouldn't expect to see DVD's/CD's in your mail box before December. 

But then, I could be wrong... and it wouldn't be the first time.

Wednesday, August 03, 2005 9:04:29 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   General | SQL | Visual Studio  | 
# Tuesday, August 02, 2005

I have a DataGridView where I allow users to type in cell values, but I only want upper case.  To do this, you need to capture the control as it's being created and assign a KeyPress handler.  E.g:

    private void MyGrid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
    {
      if (e.Control is DataGridViewTextBoxEditingControl)
      {
        e.Control.KeyPress += new KeyPressEventHandler(Control_KeyPress);
      }
    }


    void Control_KeyPress(object sender, KeyPressEventArgs e)
    {
      e.KeyChar = e.KeyChar.ToString().ToUpper()[0];
    }

Of course, you can extend this further to do all sort of things, but if your requirements are complex then it's probably advisable to create your own custom column.

Tuesday, August 02, 2005 10:09:30 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [2]   Visual Studio  | 

I like IE7, it's clean and fast and seems pretty stable.  HOWEVER, Work Item Tracking in Visual Studio 2005 Team Suite does not like it.  It causes VS to crash.

Luckily it uninstalls nicely and restores IE 6 as it was, so no harm done.

Tuesday, August 02, 2005 9:37:18 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General | Team System | Visual Studio  | 
# Monday, August 01, 2005

Last week I had a small disaster with the source control in Team System.  I managed to overwrite 3 files and lost about 2 weeks work.  The files has not been checked in correctly since mid June.  This was not a nice thing to happen :{

For some reason known only to - pick your God here - I mucked around with the file attributes on these files and then did a "Get Latest", which of course, overwrote the local versions with the old server versions.  Yes, that was a stupid thing to do!  However, I still haven't a clue why the files where not getting checked in correctly.  It may have something to do with the readonly file attributes being out of sync or something else.

So, a word of warning, don't get too comfortable with the Source Control yet - IT'S A BETA !!!  Go and check now that all your files are being checked in correctly and before doing a Get Latest, backup your local versions.

Roll on beta 3...

Monday, August 01, 2005 8:45:45 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   Team System | Visual Studio  | 
# Wednesday, July 20, 2005

After logging in, be sure to visit all the options under Configuration in the Admin Menu Bar above. There are 26 themes to choose from, and you can also create your own.

 

Wednesday, July 20, 2005 7:00:00 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   dasBlog  | 
# Tuesday, July 19, 2005

I'm not the most efficient coder.  Things like Resharper are a waste of time for me.  I prefer to repeat myself 4 million times rather than learn 23,000 keyboard shortcuts.  I think it's something to do with creative flow.

However, sometime you see things that are so easy and quick to use that you just adopt them without thinking.  Snippets are one of these.  David reminded me of this.

So, here's a custom snippet I created for inserting properties. This is pretty much the same as the default prop snippet, but I've added summary comments and I like my member vars to have a leading underscore:

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
 <CodeSnippet Format="1.0.0">
  <Header>
   <Title>jprop</Title>
   <Shortcut>jprop</Shortcut>
   <Description>Code snippet for property and backing field</Description>
   <Author>Peter G Jones (modified version of prop from Microsoft Corporation)</Author>
   <SnippetTypes>
    <SnippetType>Expansion</SnippetType>
   </SnippetTypes>
  </Header>
  <Snippet>
   <Declarations>
    <Literal>
     <ID>type</ID>
     <ToolTip>Property type</ToolTip>
     <Default>int</Default>
    </Literal>
    <Literal>
     <ID>property</ID>
     <ToolTip>Property name</ToolTip>
     <Default>MyProperty</Default>
    </Literal>
    <Literal>
     <ID>field</ID>
     <ToolTip>The variable backing this property</ToolTip>
     <Default>_myVar</Default>
    </Literal>
   </Declarations>
   <Code Language="csharp">
        <![CDATA[/// <summary>
  /// Backing variable for property $property$
  /// </summary>     
  private $type$ $field$;
  /// <summary>
  /// Property $property$
  /// </summary>
 public $type$ $property$
 {
  get { return $field$;}
  set { $field$ = value;}
 }
 $end$]]>
   </Code>
  </Snippet>
 </CodeSnippet>
</CodeSnippets>

I can see that creating more elaborate snippets is pretty easy.  I wonder if it would be possible to have CodeSmith snippets?  That would be really cool!

Tuesday, July 19, 2005 7:23:45 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   Visual Studio  | 
# Monday, July 18, 2005
Monday, July 18, 2005 3:40:21 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Friday, July 15, 2005
Nigel has got the TechEd session schedule up on the event site. 
Friday, July 15, 2005 12:04:32 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Tuesday, July 12, 2005

We recently had a minor incident with our visa cards - someone who shall remain nameless lost HER purse.  After much searching we decided to do the right thing and cancel our joint visa card.  Ten minutes after doing this, the purse rematerialised.  Joy.

Wev'e been waiting for nearly 2 weeks to get replacements (they are made about 2 minutes walk from where I work) and during that time Telecom tried to charge us.  It failed of course, becuase I don't have the new card number to give them.

Today, we had a call at home from an automated service.  It said to call 128.  Fair enough I guess, their staff must get a lot of abuse so why not have a machine do it. So, I dialled 128 and was given a choice of 5 different options, none of which matched my circumstances, so I picked 'you have been contacted by a collection agency'.  Then I was given another menu with 5 options - I can't remember what that was but I selected something close enough.  Then I had to select whether I was calling from the phone concerned or another phone.  I was calling from work so I selected option 2.  Then I had to enter my home phone number.  Then it wanted the last five digits of my account number - which I didn't have.  Phone home, get the lad to give me the number, repeat.  Got back to where I left off and enter the last 5 digits.  She says "That's Great!".  Yeah right.  But first, I need to enter a pin number.  Arrrrrrrrrgggggggg!!  Or select 0 to speak to a person.  Yay! Finally.

But here's the lovely part, the lady I finally got to speak with did not have my account details in front of her so all that time I wasted entering phone numbers & account numbers was completely pointless.

Grrrrrrr.

Tuesday, July 12, 2005 12:44:30 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 

Sean has posted about the new pricing of MSDN Universal in NZ.  A 48% price drop is pretty bloody fantastic! 

If you are in the unfortunate position of having to pay for this yourself - or you have to convince a penny pinching boss - then now is the best time ever to get MSDN.  I'd like to know the full retail value of all the software you get in MSDN (plus the free support!) - I'm guessing it's pushing $50k but it could be a lot more.  ~$3500 is a complete steal!

Tuesday, July 12, 2005 7:18:40 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 

Darryl posted about an interview with Steve Balmer and the subsequent flood of slashdot abuse.

I watched the video.  It's nice to actually see Mr Balmer speaking - albeit for such a short interview. It's gratifying to witness his obvious devotion to developers.  It gave me a brief warm fuzzy feeling.

However, I also read some of the crap that slashdot posters said about his comments on open source and innovation.  There's no point to replying on slashdot, no point at all, so I'm doing it here.

Open Source is good. MS knows this.  They are a significant provider of open source code - just look at MSDN for a while, what about www.ASP.Net, www.GotDotNet.com, www.WinForms.net?  To say that MS doesn't understand or 'get it' is just plain silly.

From a business point of view, GPL and it's ilk are the devils spawn and stiffle innovation.  MS also knows this.  As a large (or small) company it would be extremely unwise to use any code that is covered by GPL.  For MS, this is a huge threat.  There are squillions of eager lawyers just waiting for the smallest infringement.

 

Tuesday, July 12, 2005 7:10:16 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   General  | 
# Monday, July 04, 2005

I'm trying to format contents of a cell in a DataGridView using the following code:

private void RosterGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
  ShiftCell sc = e.Value as ShiftCell;
  if (sc != null && sc.RosteredShiftRow != null)
  {
   if (!sc.RosteredShiftRow.ShiftRow.IsForegroundColorNull())
     e.CellStyle.ForeColor = Color.FromArgb(sc.RosteredShiftRow.ShiftRow.ForegroundColor);
   if (!sc.RosteredShiftRow.ShiftRow.IsBackGroundColorNull())
     e.CellStyle.BackColor = Color.FromArgb(sc.RosteredShiftRow.ShiftRow.BackGroundColor);
   e.Value = sc.ToString();
   //e.FormattingApplied = true; // tried this and it make no diff
  }
}

This should set the current cell colours for some cells only.

However the result is crap:

Anyone got any ideas?

Update:  I fixed this by making sure I set the background colour to something valid.  Sometimes is was being set to 0 and other times it was not being set at all.  Now I either set both colours or none and it works really well. 

Monday, July 04, 2005 12:20:14 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General | Visual Studio  | 
# Wednesday, June 29, 2005

I'm not normally one to blog on political, racial or religious issues, but some things are just too incredible to resist.  I refer of course to this:  http://news.bbc.co.uk/2/hi/americas/4631421.stm.  Ronald Regan was voted the Greatest American of all time.  The rest of the list of top 10 also looks decidedly dodgy.

This survey polled over 2 million citizens so you would like to think it's pretty representative - at least amongst Discovery Channel viewers and AOL users - so this is a huge worry.  Surely the intelligence level has not dropped so far?  Now I'm certainly no expert on American history but off the top of my head, I can think of one or two American's who I think are greater.  e.g. Henry Ford.

I wonder if New Zealand could come up with a better list or would it look something like this:

  1. Robert Muldoon
  2. Russell Crowe
  3. Sean Fitzpatrick
  4. Judy Bailey
  5. Micheal Campbell
  6. Lana Cocroft
  7. Edmund Hillary
  8. Tama Iti
  9. Neil Finn
  10. Gandi

 

 

Wednesday, June 29, 2005 2:06:44 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   General  | 
# Thursday, June 16, 2005

Rob Caron has posted that the June CTP of Team System is available for download.

I've got too much on at present to bother with this and we were also asked not to upgrade or patch past Beta 2 as part of some programs we are on with Microsoft.

I'd really like a new cut of Visual Studio though.  Some of the bugs drive me nuts.

Thursday, June 16, 2005 1:06:47 PM (New Zealand Standard Time, UTC+12:00)  #    Comments [0]   Team System | Visual Studio  | 

Wow!  My boss found this yesturday - I think it's a new feature in VS05 because I've never seen it before.  I'll be really annoyed if it's been in VS03 and I just never found it.

When you create a winform user control you normally need some container to test it in.  In the past I've always just done this as part of the larger application.  Now, when you have a control library project in VS, you can hit F5 and it will launch the UserControl Test Container:

Even better, you can load froms from any dll or exe:

Very cool!  This is a lot like the old ActiveX test container - but way nicer to use.

Thursday, June 16, 2005 9:16:21 AM (New Zealand Standard Time, UTC+12:00)  #    Comments [1]   Visual Studio  | 
Copyright © 2012 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: