Wednesday, October 3, 2007

Microsoft is releasing the .Net 3.5 framework source

Microsoft has announced they will release the source code for the .Net framework libraries with the release of Visual Studio 3.5.

The source will be released under the Microsoft Reference License. In addition an Internet facing symbol server will allow you to grab the debugging symbols from within Visual Studio.

All the details can be read over at ScottGu's blog.

Monday, September 24, 2007

XML Literals in VB 9.0

  I usually live in the C# world, have been since 1.0 of the .Net framework. Back then I was interested in VB.Net until the "Don't change VB" crowd started clamoring, at that point I knew that for at least the time being VB.Net would be crippled so I moved on to C#. I've looked at it from time to time since 1.0, but none of it's features has really stood out from the crowd, until now.

  I've spent a great deal of time looking at an experimenting with the .Net 3.5 changes around LINQ and C# and VB.Net are equally matched, with the exception of XML Literals, which is a VB only feature. So what is an XML Literal? Quite simply it's the ability to embed XML directly into your code. Ok, your saying, "I can do this today, so what's the big deal?", the big deal is the XML is a first class object, not a string! In addition to embedding the XML directly in your code, you can also embed expressions in the form of "<%= [exp] %>", which allows you to populate the XML programmatically.

Here's a VB.Net code snippet that populates an XML Literal using an expression to assign the element values:

Public Function PopulateXml(ByVal boundary As Boolean _
                                            , ByVal endPoint As Boolean _
                                            , ByVal vertex As Boolean) As XElement
       Dim snapSettings As XElement = _
           <Boundary><%= boundary.ToString() %></Boundary>
           <Endpoint><%= endPoint.ToString() %></Endpoint>
           <Vertex><%= vertex.ToString() %></Vertex>

       Return snapSettings
   End Function


The code example above returns a LINQ XElement object, the nodes are populated using the expression defined inside the XML.In the end this allows you to produce XML output that matches the original document format and it's embedded right in the code.

 My hats off to the VB team for this little gem, I hope the C# team pays attention and adds it to C# 4.0.

Monday, September 3, 2007

LINQ and Geocoding

Last week had an opportunity to present an overview of LINQ to my coworkers during a brown bag training session. I ran across this article on LINQ and geocoding by Rob Conery, that provides a interesting look at using LINQ to query a to find hotels that a closer than 100 miles.

Friday, August 31, 2007

SQL Server 2008 Date and Time changes

  There are a number of date and time changes coming in the next version of SQL Server 2008 which is currently scheduled for release towards the end of 2007 or early 2008.

 Date and time are now a separate  data types which may make the argument to switch from competing DBMS a little easier. In addition to the new date and time data types, SQL also adds datetimeoffset data type and datetime2 data type.

Here are the highlights of the new data types

Data Type Notes Storage
Date aligns with .Net and SQL Standard data type, supports multiple formats 3 bytes
Time(n) "n" indicates milliseconds precision by default this value is 10 nanoseconds which aligns with windows. 3- 4 bytes
Datetimeoffset(n) Date time offset provides a "time zone aware" data type. date time offset take a parameter that contains the millisecond precision. Time zones from -14:00 to +14:00 are valid  8-10 bytes
datetime2(n) "n" indicates milliseconds precision by default this value is 10 nanoseconds which aligns with windows. 8-10 bytes


In addition to adding these new data types SQL Server 2008 also introduces changes in the built in functions, such as GETDATE(), DATEADD() and DATEDIFF() to support these new data types.

The date time changes are welcome additions to SQL server and provide a flexible platform on which to build enterprise applications.

Monday, August 27, 2007

Entity Framework Beta 2 and Tools CTP released

 The ADO.Net Team have released Beta 2 of the Entity Framework an the first Framework Tools CTP.

 You can get the details on the release at the ADO.Net Team Blog

XML Schema Designer

 I just saw that the first CTP for the XML Schema designer is available for download. The designer is a graphical tool for working with XSD schemas, It plugs into Visual Studio, and this CTP only supports VS2008 Beta 2. You can grab it here.

Some interesting LINQ resources

 I ran across Hooked on LINQ today while doing some research for a class I'm putting together for my co-workers on the .Net 3.5 features. It's a well laid out site with a ton of LINQ information, definitely worth a visit. 

 ScottGu's Blog is another great site, as always Scott provides a great deal of insight and examples.

Friday, August 24, 2007

LINQ to DataSets

Erick Thompson has posted an article on LINQ to DataSets. It's a great primer on LINQ querying ADO.Net DataSets. 

Thursday, August 23, 2007

LINQ misconceptions

 Time and time again I heard coworkers  that "X" (insert your favorite ORM tool) is far superior to LINQ in regards to ORM and time and again LINQ is not really about ORM. Yes LINQ to SQL has some ORM type features, but it's not really a pure ORM platform.

  LINQ is really, at least in my opinion, about the language query functionality. It gives .Net programmers the power to write queries against not only SQL objects but native objects and XML in a language they are comfortable working in.  LINQ really shines in when used to query object collections and XML, operations that would have previously taken a dozen lines of code and nested loops is now as simple as a query. To me that is the power of LINQ.

  Yes the SQL database modeling and LINQ to SQL is equally as compelling, but I think people are to wrapped up thinking in terms of ORM tools that the miss the real functionality or how it can be leveraged to solve real business problems today.

 So next time you here someone comparing LINQ to ORM, tell them it's not about ORM, it's about the query.

Monday, August 13, 2007

LINQ file info code

 Here is a LINQ sample in C# based on the VB.Net How Do I? videos. To set this up create a simple windows form application, add a DataGridView and dock it to the form.

Place the following code in the form load event handler:

System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();


           var files = (from  file in Directory.GetFiles(Application.StartupPath)
              select file);

           var fileInfo = (from file in files
                          select new FileInfo(file));

           var myFiles = from file in fileInfo
                         select new FileOps { Creation = file.CreationTime, Name = file.Name };

           dataGridView1.DataSource = myFiles.ToList();


           TimeSpan ts = watch.Elapsed;

               ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));


To use the object initializers with anonymous types add the following class nested in the form class:

public class FileOps
      public string Name { get; set; }
      public DateTime Creation { get; set; }


You'll notice we start looking in the application startup directory, just replace it with the directory of your choice to try other directories. You can comment out the timing code if you just want to run the sample without a message box.


Wednesday, August 8, 2007

The declining value of customer loyalty

 I've been weighing the benefit of renewing my Infragistics NetAdvantage subscription over the past couple of weeks and I think for the first time since 2002 I will not renew may subscription.

  Here's the issue, I've been a loyal customer since 2002, provided feedback, reported bugs and endorsed the product to co-workers and manages. My managers have always went and purchased company licenses on my recommendation.  I really like the tools overall and they generally add value each release. That said, last year early renewal was $335 which is expensive but not unreasonable, this year $445, a hundred dollars difference. They also like to send the renewal requests incrementally, 20% then 10% then nothing off all about 30 days apart, seems to me it should be the other way around, 10% then 20% to keep loyal customers. 

  The price isn't the only issue. I used to receive notice of new releases and upcoming betas,now I get nothing. I actually asked why this was on their PM's blog, the answer was that they may not have a current email address. That's funny because they can certainly reach me for a renewal request.

  So I'm going to start looking around for something comparable for another vendor, one who may actually value loyal customers. 

Sunday, August 5, 2007

.Net 3.5 gems

 So often when a new release of the .Net framework is upon us we hear about the new "shiny" pieces, which while important, doesn't convey the fact that other parts of the framework are receiving attention as well.

  A case in point is the OpenFileDialog, I noticed some new properties for SafeFileName and SafeFileNames which weren't there in 2.0. I'm sure there are a bunch of other enhancements and additions, some like these are probably there to support Vista.

 At any rate my hats off to the guys/gals who add the non "shiny" parts that make our jobs easier on a daily basis.  

Saturday, August 4, 2007

Visual Studio 2008

 I've had a chance now to spend a fair amount of time with Visual Studio 2008 and so far has been solid. Right now I'm spending a lot of time getting familiar with all the new C# 3.0 features. It's always a lot of work staying ahead of the changes. So far my favorite IDE enhancement has to be the WPF editor, it's come a long way since it's preview days. My favorite language feature has to be Linq or Language integrated query. This is a great addition and it has made one of those often tedious tasks easy.

 More than once I've had to compare the contents of two lists to determine what exists in one that isn't in the other. I'm currently working on an app that imports a file, this file is always appended to, so I just need to add the new items to my collection, linq makes it a snap, here's the code.

IEnumerable<string> entryQuery =
          (from s1 in entries
           select s1).Except
            (from s2 in currentEntries
             select s2);

           //update the current entries to reflect the additions
           foreach (string s entryQuery)

I've seen and implemented Equals on the collection, but most of the time you end up with the same record multiple times, with linq on one copy of any item is added.

Friday, July 27, 2007

Orcas Beta 2

Microsoft has released beta 2 of Orcas You can download it from here. This release is really coming along in terms of functionality and usability especially the WPF editor.

Thursday, April 19, 2007

Visual Studio "Orcas" and .Net 3.5 Beta 1 released

Microsoft has released  You can download it from the Microsoft download site. It can be downloaded as a VPC image of the Team Suite or if you're an MSDN subscriber the Pro version has already been posted.

Wednesday, April 11, 2007

SQL 2005 SP2 Re-release and post fixes

Bob Ward has posted an article that explains the re-release of SQL 2005 SP2 and the various hotfixes posted later. If your using, deploying or developing solutions for SQL 2005, you'll want to check the article out. You can check it out here.

Sunday, April 8, 2007

Workflow starter kit released

Microsoft has released the first starter for Windows Workflow foundation. The starter kit is a web based task oriented workflow example. The starter kit demonstrates predefined roles for creation, approval and monitoring.

Wednesday, April 4, 2007

Expression Blend and Web are finally added to MSDN

 Microsoft has been sending conflicting and ambiguous messages regarding these products for some time.

 At one point they attempted to make the distinction between designers and developers, but let's face it, I have yet to see a small to mid-sized organization that had that separation. In reality we often wear both hats. So to me it just makes sense to be able to have the right toolset available to accomplish the task at hand.

You can catch all the details at Somasegar's WebLog.

Saturday, March 31, 2007

WCF performance Whitepaper

 The Connected frameworks team at Microsoft just released a whitepaper titled A Performance Comparison of Windows Communication Foundation (WCF) with Existing Distributed Communication Technologies. It's an interesting read and if you're looking to sell WCF in your organization, this will be a valuable reference.

While your looking at the WCF whitepaper,they previously released a WWF whitepaper, Performance Characteristics of Windows Workflow Foundation, which discusses Workflow performance.

Wednesday, March 28, 2007

SQL Server 2005 Adoption rate survey

SQLServerCentral just posted a SQL 2005 adoption survey. They surveryed 610 site users and the results are pretty interesting.

In my organization we currently use SQL 2000 for most of our production applications, but that said, we are also migrating toward 2005 with newer applications. Probably single bigest reason I've seen to favor 2005 over 2000 is ETL. I haven't seen alot of adoption for many of the new features such as CLR integration, XML and XQuery and even the Service Broker for that matter. Some that I would venture to guess is a result of developers using tried and true methods.

Tuesday, March 27, 2007

Unit testing tools will be in Visual Studio Professional (Orcas)

This one is long over due. When Visual Studio 2005 was in beta there was a alot of contraversy that the test tools would only be included in the team suite. Many organizations are not willing to purchase the team suite, either due to cost or they simply don't need the tools. As a result we still have many organizations that do not utilize unit testing and those that do are probably using NUnit or something similar. Somehow the message has gotten through to redmond and Orcas will finally deliver unit test tools that don't require the purchase of the team suite.

 You can check out the details in Naysawn Naderi's blog

Saturday, March 24, 2007

SQL 2005 and VS 2005 on Vista

To run SQL Server on Vista, you're going need Service Pack 2,  you can find the link in my previous post on SQL 2005 SP2. Make sure you check the Vista provisioning checkbox after the service pack completes. This will allow you to properly configure the SQL administrator accounts.

If you are installing Reporting Services in Vista you need to configure IIS 7 for IIS 6 compatibility, otherwise you'll get a message about "IIS Feature Requirement". This because  the SSRS pre-requisites checks for IIS 6 and not IIS 7.  IIS 7 comes with some IIS6 compatibility extras that will allow you to install SSRS. You will need to go into "Turn Windows features on or off" in control panel and install following IIS 6 Features found under Internet Information Services 

Web Management Tools

  • IIS 6 Management Compatibility

  • IIS 6 WMI Compatibility

  • IIS Metabase and IIS 6 configuration compatibility

World Wide Web Services

  • Application Development

    • .NET Extensibility

    • ASP.NET

    • ISAPI Extensions

    • ISAPI Filters

  •  Common HTTP Features

    • Default Document

    • Directory Browsing

    • HTTP Redirection

    • Static Content

  •  Security

    • Windows Authentication

Lastly if you are running SSIS packages with scripts you will need this hotfix.

For Visual Studio 2005 you'll need to run Service Pack 1 which you can get here. Depending on what features that you have installed, the service pack may take several hours to run and you'll be prompted several times to answer yes or no. There has been discussion that you can reduce the installation time by not installing C++, so if you don't need it, it may be worth it to leave it out.

You'll also need to install the Visual Studio Service Pack 1 update for Windows Vista, which you can get here. This update insures backwards compatibility with UAC and Areo.

Thursday, March 22, 2007

Orcas March 2007 CTP

 I've been running this CTP on the Longhorn server CTP for a few weeks now and so far I'm really pleased with the changes in Visual Studio. One of the more interesting additions aside from LINQ is the integration of the Expressions web editor for Web applications and the integration of the WPF editor and WWF designer. Anyway pick up the CTP and have a look for yourself.

SQL 2005 SP2

 If you haven't downloaded the latest service pack for SQL 2005, I recomend you grab it from here. This release touches every major aspect of SQL 2005, the "What New" can be found here.

 If you're using SQL EXPRESS the SP2 download is here.

Wednesday, March 21, 2007

Choosing between WF and BizTalk

 Guy Burstein gives four simple questions you should ask when deciding between Windows Workflow and BizTalk Server. You can find it here.

Friday, March 16, 2007

Windows Workflow

 I've been spending time discovering the capabilities of the Windows Workflow Foundation in the .Net 3.0 framework. This by far the most flexible workflow framework I've seen in a long time. Most of the articles on the web tout the Windows Presentation Foundation or Windows Communications Foundation features with very few workflow articles.

 What makes this a powerful solution is the plugin nature of the workflow services as well as the ability to model activities in a domain specific fashion.  Let's face workflow's are all around us and for the most part these are modeled in code that is fragile or by complex and expensive solutions.

 So what do you need to start developing workflows today? You'll need to install the .Net 3.0 runtime as well as the Windows Vista platform SDK. In addition if your using Visual Studio 2005 you can install the Visual Studio Extensions for Windows Workflow Foundation.

If your development includes workflows, you owe it to yourself and your team to look at the Windows Workflow Foundation as solution to solving your workflow issues.