Programming

ADO.NET Entity Framework – Code First Development Pattern

Here’s a quick start introduction to the ADO.NET Entity Framework Code First Development Pattern. For a more complete (but still intro) walkthrough, check out ScottGu’s blog. At the time of this writing, you’ll need the EF 4.1 Release Candidate. After EF 4.1 is released you’ll no doubt be able to find it on the ADO.NET team blog. 1. Create a new empty ASP.NET MVC2 Web Application, add a reference to System.Data.Entity. If using the EF4.1 RC - add a reference to the EntityFramework dll that comes ......

Posted On Thursday, April 14, 2011 3:42 AM | Comments (0)

Visual Studio 2010 Find and Replace With Regular Expressions

Here is a quick notes about using regular expressions in the VS2010 Find Replace dialog. 1. To create a backreference, use curly braces (“{“ and “}” ) instead of regular parentheses. 2. To use the captured backreference, use \1\2 etc, where \1 is the first captured value, \2 is the second captured value, etc. Example: I want to find*: info.setFieldValue(param1, param2); and replace it with: SetFieldValue(info, param1, param2); To do this, I can use the following find/replace values: Find what: {[a-zA-Z0-9]+}.setFieldValu... ......

Posted On Thursday, March 10, 2011 5:07 PM | Comments (1)

New RSS Reader for Outlook

New RSS Reader for Outlook announced at Gnomedex. I'll check it out, but I love Feeddemon.

Posted On Friday, June 24, 2005 9:34 AM | Comments (0)

Audible Announces RSS Delivery

This press release from Audible details plan to offer secure RSS feeds. Audible made the announcement today at Gnomedex.

Posted On Friday, June 24, 2005 9:27 AM | Comments (0)

Microsoft RSS Team?

Dave Winer hints that we'll get a peak at what Microsoft is doing with RSS tomorrow at Gnomedex.

Posted On Thursday, June 23, 2005 5:27 PM | Comments (0)

Creating Team Foundation Work Items With PowerShell

Here is the simple function I added to my powershell profile: function create-tfstask ($desc) { tfpt workitem /new $workItemType /collection:$serverUrl /fields:"Title=$($desc);Ass... To=$assignee;AreaId=$areaId... } To find the AreaId and IterationId for your project/versions, just look at a bug you know is setup correctly: PS C:\> tfpt query /collection:http://3bs001vs... /wiql:"select AreaId,IterationId from workitems where ID = 879" Next I hooked this into ......

Posted On Wednesday, January 26, 2011 10:58 AM | Comments (1)

How do I rollback a TFS check-in?

I can never remember how to rollback a check-in, and there all kinds of mess in search results about this (change between different versions of TFS etc), so I thought I’d just put this here so I won’t forget anymore. :) Thanks to @manningj, TFS genius. Just drop to the command line and use tf.exe. Example: tf rollback /changeset:12345 For more on the tf.exe commands: tf help Technorati Tags: Visual Studio,Team Foundation,Rollback ......

Posted On Tuesday, December 21, 2010 11:24 AM | Comments (2)

PowerShell – Recycle All IIS App Pools

With a little help from Shay Levy’s post on Stack Overflow and the MSDN documentation, I added this handy function to my profile to automatically recycle all IIS app pools. function Recycle-AppPools { param( [string] $server = "3bhs001", [int] $mode = 1, # ManagedPipelineModes: 0 = integrated, 1 = classic ) $iis = [adsi]"IIS://$server/W3SVC/... $iis.psbase.children | %{ $pool = [adsi]($_.psbase.path); if ($pool.AppPoolState -eq 2 -and $pool.ManagedPipelineMode -eq $mode) { # AppPoolStates: ......

Posted On Thursday, December 16, 2010 3:59 PM | Comments (0)

Setting a Master Page Dynamically

To set an ASPNET master page dynamically, use the Page_PreInit function and set the Page.MasterPageFile property. For example: protected void Page_PreInit(object sender, EventArgs e) { this.Page.MasterPageFile = "~/MasterPages/" + mymaster + ".Master"; } In the above example, mymaster should be set by whatever your requirements dictate – read from DB/CMS/whatever. The page (aspx) itself shouldn’t have any other reference to the master page (ie, no “MasterPageFile attribute in the page directive), ......

Posted On Tuesday, August 17, 2010 3:04 PM | Comments (2)

PowerShell TruncateAtWhitespace Function

Here’s a TruncateAtWhitespace function that takes an incoming parameter value and an incoming max length, and returns a substring broken at a whitespace position. This way if you have “Lance has a blog” and you need to truncate it to 8 characters or less, you get “Lance” instead of “Lance ha”. function TruncateAtWhitespace{ param( [string]$value, [int]$maxlength=200 ) $maxlength-=3; #allow for "..." suffix if ($value.Length -le $maxlength) { return ($value + "..."); } $closestwhitespaceindex = [int]$value.Substring(0, ......

Posted On Monday, August 16, 2010 3:30 PM | Comments (0)

TwitterMinder and Flickr->Twitter scripts

If you’re an RSSBus user who is using my Google Calendar –> Twitter or Flickr –> Twitter services, you might notice a minor change to both. I changed Twitterminder so that tweets resulting from Google Calendar entries are prepended with “GCal: “. I did the same thing with the Flickr->Twitter script, it will now prepend “Flickr: “. Related: How to call these services from your own applications. Related: How I converted TwitterMinder into Flickr->Twitter by changing 4 lines of code ......

Posted On Thursday, August 28, 2008 1:58 PM | Comments (0)

quickly add zip and credit card functionality to applications

James Shaw mentioned how easy it was to add zip and credit card functionality (using nsoftware components) to a recent website he helped build recently. Technorati : ibiz, ibiz e-payment, ipworks, ipworks zip ......

Posted On Friday, December 15, 2006 4:01 PM | Comments (0)

CSharp TruncateAtWhitespace Function

Here’s a TruncateAtWhitespace function that takes an incoming parameter value and an incoming max length, and returns a substring broken at a whitespace position. This way if you have “Lance has a blog” and you need to truncate it to 8 characters or less, you get “Lance” instead of “Lance ha”. /// <summary> /// Truncate at the end of a word /// </summary> /// <param name="value">The original string</param> /// <param name="maxlength">The maximum length of string to return</param> ......

Posted On Monday, August 16, 2010 3:28 PM | Comments (0)

Listing SPQuery FieldNameRefs

It took me a while to figure out how to get a list of all the available fields for a particular type of list in SharePoint (for performing custom queries in SPQuery). I was looking for a published list of these fields, which as far as I know does not exist. Instead, you just use the GetList method of the Lists SOAP service. Here’s an example SOAP request: <?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://sche... SOAP-ENV:encodingStyle="htt... ......

Posted On Monday, December 7, 2009 4:24 AM | Comments (0)

How to embed Excel in a .NET WinForms App

Download and install owc11. Run AxImp on OWC11.dll, which will have been installed in the microsoft shared\web components directory (ie C:\Program Files\Common Files\microsoft shared\Web Components\11\). AxImp.exe can be found in the Windows SDK (ie, C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\AxIm... In Visual Studio project, drag OWC11.dll to a toolbox tab and drop the Excel component on form. Voila. When it comes deployment time, you’ll need the AxInterop.OWC11.dll. Some sample code: ......

Posted On Thursday, September 17, 2009 9:19 AM | Comments (1)

followthemoney.com

Featured on Programmable Web a couple weeks ago was an API from the Institude On Money in State Politics that allows you to track campaign contributions for candidates. It is pretty neat, and should come in quite handily in 2008. Here is their a view of their data for North Carolina. A while back I posted about Project Vote Smart, and the news that they are planning to make an API available "well before the 2008 elections". With the massive amount of information available at Project Vote Smart, this ......

Posted On Thursday, November 9, 2006 4:23 PM | Comments (0)

Four New Developer Toolkit Releases from /n software

Last week /n software announced new versions of three different toolkits, and a brand new SharePoint Integrator product. From nsoftware.com: NEW: /n software UPS Integrator V2 Released! Includes easy access to the most popular UPS mail capabilities including shipping, tracking, address verification, rate calculation, and much more. NEW: /n software SharePoint Integrator Released! Enables developers to build applications that integrate with Microsoft SharePoint Server, including components for working ......

Posted On Wednesday, July 15, 2009 1:53 AM | Comments (0)

Pass by Reference Parameters in PowerShell

A long time ago Jeffrey Snover briefly mentioned the PowerShell [REF] parameter attribute, but otherwise there isn’t much mention around about how to use it. It seems simple enough, but I kept getting this error from PowerShell: “Reference type is expected in argument.” This post by MOW cleared things up for me – I needed to wrap my [REF] parameters in parens in the function call, like so: Find-NewMessages $valvar1 ([REF]$refvar1) ([REF]$refvar2) For those looking to see how pass by reference params ......

Posted On Wednesday, January 14, 2009 5:06 PM | Comments (3)

New nsoftware Releases for SharePoint, BizTalk, SSIS

Today /n software announced new versions of three more toolkits today: SharePoint Extensions V3 BizTalk Adapters V3 SSIS Tasks V3 I have been involved in building these products, so if you have any questions feel free to let me know. Technorati Tags: BizTalk, SharePoint, SSIS ......

Posted On Friday, January 9, 2009 3:38 PM | Comments (0)

Amazon EC2 developer component

/n software’s new Amazon Integrator toolkit is now available (it was just released today!) for software developers: Amazon Integrator V3 with EC2 & SimpleDB Now Shipping! Integrate popular Amazon Web Services, including S3, SQS, SimpleDB, AWS, and EC2 with your applications. All Editions Now Shipping: .NET, Java, C++, ActiveX, Delphi, & C++ Builder! Technorati Tags: Amazon, AWS, nsoftware ......

Posted On Friday, January 9, 2009 3:25 PM | Comments (0)

Full Programming Archive

Copyright © Lance Robinson

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski