4 October 2011 0 Comments

Learning Windows Development with Quickstarts and How to’s

In coordination with the Windows developer preview release for the Build conference, we quietly have added a few new page types across our content sets and today I’ll talk about two very important ones: Quickstarts How-tos These are important because you can find the specific type of content that you are looking for by searching on the developer centers with the keyword “Quickstart:” or “How to:” and can also get right into the code by keeping an eye out for these keywords in page titles. Quickstarts The new quickstart page type is designed to quickly get you introduced to a scenario or feature without getting in to the details but instead focusing on just the essentials.  For example, the Adding a flyout quickstart will get you going in just a few minutes from the Building your first Windows Metro style app with JavaScript to having a  simple Metro style app with a flyout.  Another great example is the Quickstart: Adding an app bar page which will quickly get you going from having a simple Metro style app to having a Metro style app with an app bar on the bottom of the screen. Check the see also section for some more examples of quickstart documentation

25 November 2010 0 Comments

How to send email and create appointment item using EWS Managed API in VB.net?

It does seem to be a bit of a dearth of VB.net samples for Exchange Web Service Managed API. So here is a sample VB.net code which demonstrates: Send Email Create Appointment NOTE: Following programming examples is for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose

2 April 2010 0 Comments

Announcing the Tips and Tricks SWAG Fest Beginning April 12th

  So, someone thought it would be a good idea to give me some money for SWAG to give to my readers.  Naturally, I loved the idea!  So I went and bought a whole bunch of $100 ThinkGeek gift certificates.  The problem is how to give them away?  After much thought (about 10 minutes, at least), I figured the best way was to give them away whenever I felt like it.    Okay so there you have it.  Beginning April 12th (Visual Studio 2010 Launch Day) I will be giving away ThinkGeek gift certificates.  I’ll be picking people who show love for the Visual Studio Tips and Tricks blog.  There are some basic ways you can do this:   Leave some cool comments on the tip(s) you like the most Tweet about the Tips blog using the #vstips hashtag Show some blog love by cross posting to your blog if you have one Feel free to get creative and let me know about it.  That’s pretty much it.  Very simple really.  Look for the fun to begin on Launch Day.

8 March 2010 0 Comments

How to Create a Powershell 2.0 Module and Cmdlet with Visual Studio 2010 (Screencast included)

This is one of those tasks I need to repeat every now and then and always forget the exact steps. So in the interest of sharing, I’ve written this post to demonstrate how to get started building a very simple module and cmdlet with C# and Visual Studio.

7 February 2010 0 Comments

How to: Create Interfaces with Static Methods via IL?

If you try to add a static member to an interface, you will get the following error: The modifier ‘static’ is not valid for this item In this case, you should create an abstract class instead of an interface, because interfaces are contracts and should not implement any methods. However, it’s still possible to do so using IL. The error above was produced because of the following rule in the CLI spec : “CLS Rule 19: CLS-compliant interfaces shall not define static methods, nor shall they define fields….( read more )

28 January 2010 0 Comments

How to: Debug Deadlocks Using Windbg?

Attach the debugger to the process Load SOS ~* e !clrstack to view the CLR stack of all the threads and where they are Look for System.Threading.Monitor.Enter(System.Object) in the top frames Load SOSEX.dll from http://www.stevestechspot.com/SOSEXUpdatedV11Available.aspx !dlk to detect deadlocks. The output looks like the following: Deadlock detected: CLR thread 5 holds sync block 0018f05c OBJ:010d909c[Microsoft.Sample.SampleEvent]             …( read more )

3 August 2009 0 Comments

One More Sparkline Trick

In this blog post I’ll walk through one more interesting way you can use sparklines in Excel 2010. In the above example we have the sales for each book category and for each store.  While you can’t see the exact numbers in this view, you can get the feel for which sections sell well at the different stores.  Let’s see how this is made with sparklines in Excel: There are actually 24 sparklines in the picture above; each one is bound to a single data point in a similar table with the numbers.  You can create this in one swoop with the Insert Sparkline dialog by selecting the rectangle of cells for the location, and then select all of the sales numbers as the data source.  This isn’t really an intended use for sparklines since each one only has a single data point, but it’s an interesting visual that could be useful with some more context in a report or dashboard

14 July 2009 0 Comments

Visual Studio 2010 EF4 新機能 Model Defined Functions (MDF)

こんにちは、部内は ReMIX そして Tech·Ed モードになっています。 ReMIX で私は「 UX コンシェルジュ」というブースでアテンド予定ですので、お時間あれば立ち寄って頂ければと思います。   今日は EF4 で機能追加される Model Defined Functions (MDF) をご紹介します。 Model Defined Functions (MDF) は .NET Framework 4.0 における新機能です。機能名から予測できるとおり概念モデル (CSDL) に関数を定義することができます。定義した関数には Entity SQL や LINQ to Entities でアクセスすることが可能です。 MDF は例えば、人の年齢計算のような共通で関数化しておくと便利なものに適用するものです。   では実際の実装方法を確認してみましょう。 関数を定義するために、 CSDL に次のような <Function> 要素を持つ XML を記述する必要があります。 VS デザイナで edmx を作成した場合は、 edmx を XML エディターで開いて <ConceptualModels> 要素の子要素である < Schema> 配下の任意の場所に記述することになります。 < Function Name = ” GetAge ” ReturnType = ” Edm.Int32 ” > < Parameter Name = ” Employees ” Type = ” NorthwindModel.Employees ” /> < DefiningExpression >       Edm.DiffYears(Employees.BirthDate, Edm.CurrentDateTime())   </ DefiningExpression > </ Function > XML を見ると概ね、何がしたいのかご理解頂けると思います。尚、 DefiningExpression には EntitySQL を指定します。 詳細は下記の msdn ドキュメント(英語)をご覧ください。 Conceptual Model Functions (Entity Data Model)   上記定義を行うことで次のように Entity SQL 式から GetAge 関数を呼び出すことが可能です。当然、 SQL Server など固有のデータベースには依存しない実装になります。 using ( EntityConnection con = new EntityConnection ( “Name=NorthwindEntities” )) { con Open. (); EntityCommand cmd = con.CreateCommand(); cmd.CommandText = “SELECT VALUE p from NorthwindEntities.Employees as p WHERE NorthwindModel.GetAge(p) > 60″ ; EntityDataReader edr = cmd.ExecuteReader( CommandBehavior .SequentialAccess);   また、 LINQ to Entities を用いて GetAge 関数の呼び出しを行う場合、事前に Stub メソッドを定義する必要があります。 [ EdmFunction ( "NorthwindModel" , "GetAge" )] public static int newGetAge( Employees e) { throw new NotSupportedException (); } ご覧のとおり、 System.Data.Objects.DataClasses.EdmFunction 属性に先ほど CSDL に定義した Function 名と名前空間が設定されています。実行時には Stub がそのまま呼び出されるわけではなく、 CSDL の Function が実行されるよう、メソッドが生成されることになります。 これで、 LINQ to Entities を用いて MDF を呼び出すことが可能です。 using ( NorthwindEntities db = new NorthwindEntities ()) {    var es = from e in db.Employees           where newGetAge(e) > 60           select e; } 詳細は下記の msdn ドキュメント(英語)をご覧ください。 How to: Call Model-Defined Functions in Queries (LINQ to Entities)   ちょっとパフォーマンスが心配ですが、うまく使うと便利な機能だと思います。

13 July 2009 0 Comments

Service Pack 2 prevents an on-change workflow from starting itself

Hello all, Stephen here again — I’m a writer for SharePoint Designer. I’d like to tell you about a fix that was included in Service Pack 2 for Office SharePoint Server 2007 and Windows SharePoint Services 3.0 . This fix affects workflows designed in SharePoint Designer 2007

6 May 2009 0 Comments

Video: Migrating from Windows XP to Windows 7 using the User State Migration Tool

Of interest is the TechNet information on Migrating from Windows XP to Windows 7 using the User State Migration Tool (aka USMT) . With it, you can migrate your files and settings from your Windows XP computer to a new Windows 7 installation

27 April 2009 0 Comments

New Videos: Get Started with Visual Web Developer Express 2008

Visual Web Developer Express 2008 is a free web tool that allows you to build CSS, HTML ASP.NET, C#, VB, and JavaScript and supports additional frameworks like ASP.NET MVC, AJAX, Silverlight and jQuery. ASP.NET is releasing a new series of how-to videos from beginner to intermediate.  Now’s the time to take a half hour to brush up on web development with Visual Studio.  Here are some videos you might start with: Intro to Web Forms   Intro to Visual Web Developer 2008 Check out all the videos and access the software for free at their website:  http://www.asp.net/vwd/

18 April 2009 0 Comments

How to: List changesets between two labeled versions?

You can achieve that behavior by running: tf hist rootItemSpec /r /version:LstartLabel~LendLabel Here’s my scenario: tf hist /i File.cs Changeset Change User Date Comment ——— ————————– ————- ———- ——– 65 edit mohamedg 4/2/2009 63 edit mohamedg 4/2/2009 60 edit mohamedg 4/2/2009 59 edit mohamedg 4/2/2009 50 edit mohamedg 4/1/2009 49 edit mohamedg 4/1/2009 48 edit mohamedg 3/31/2009 47 add mohamedg 3/31/2009 tf label Rev1 File.cs;48 Created label Rev1@$/Proj…( read more )