Archive for December 2006

 
 

Validation Application Block - 4 tutorials

The CTP of Enterprise Library 3.0 was released last Friday.One of the new application blocks it contains is a Validation Application Block for validating classes in your applications.David Hayden wrote 4 tutorials on how to use it:

Technorati tags: validation, dotnet, c#, tutorial

Manage database of ASP.NET 2.0 Membership & Role services in non-ASP.NET context

This article explains how to manage database of ASP.NET 2.0 Membership & Role services in non-ASP.NET context.

Technorati tags: database, dotnet, asp.net

WatiN

Written in C#, WatiN emulates the relevant portions of browser behavior, including form submission, JavaScript,cookies and automatic page redirection, and allows C# test code to examine returned pages either as containers of forms, tables, and links. When combined with a framework such as NUnit, it is fairly easy to write tests that very quickly verify the functioning of a web site.

This tutorial explains some basics to get you up and running automating Internet Explorer with WatiN.

 

 

Technorati tags: nunit, web, testing, TDD, dotnet

Bart De Smet explores the IE7 RSS platform using C#

Internet Explorer 7 introduces a unified approach to RSS. The good thing about it, is its availability for developers to consume the RSS feeds of the end-user, for example to build a custom RSS aggregator. Programs like the Windows Sidebar in Vista, the Windows Live Mail Desktop client, Outlook 2007 leverage the power of this API to provide multiple views on the same RSS information. In this series of blog posts Bart De Smet is showing you little snippets to make a jumpstart with the RSS platform.

  • Exploring the IE7 RSS platform in C# - Part 1
  • Exploring the IE7 RSS platform in C# - Part 2
  • Exploring the IE7 RSS platform in C# - Part 3
  • [Via Tom's MSDN Belux Corner]

     

     

    Technorati tags: rss, c#, dotnet, windows

    Return the value for the specific attribute using XPathNodeIterator

    I will use the following XML document in the example below.

    <?xml version="1.0" encoding="utf-8" ?>
    <users>
      <user FirstName="Tom" LastName="Adams" Age="23" />
      <user FirstName="Jhon" LastName="Brams" Age="17" />
      <user FirstName="Bill" LastName="Smith" Age="33" />
    </users>

    The code prints out all the user nodes of the users node that  have an age with a value greater than 17.

    // Read the xml from resource file 
    string xml = Resources.Users; 
    using (StringReader sr = new StringReader(xml)) 
    { 
        XPathDocument document = new XPathDocument(sr); 
        XPathNavigator navigator = document.CreateNavigator(); 
        XmlNamespaceManager ns = new XmlNamespaceManager(navigator.NameTable); 
        //Selects all the user nodes of the users node that 
        // have an age with a value greater than 17  
        XPathNodeIterator it = navigator.Select("/users/user[@Age>17]"); 
        while (it.MoveNext()) 
        { 
            // access the atributes  
            string firstName = it.Current.GetAttribute("FirstName", ns.DefaultNamespace); 
            string lastName = it.Current.GetAttribute("LastName", ns.DefaultNamespace); 
            // Print out  
            Console.WriteLine( "{0} {1}", firstName, lastName ); 
        } 
    }