Tuesday, March 31, 2009

REGISTER FOR DALLAS TECHFEST 2009

Return to Home Page

 

http://dallastechfest.com/2009

The following Technologies will be covered

  • .NET
  • Silverlight
  • Java
  • Flex / Flash
  • Cold Fusion
  • PHP
  • Register today at http://dallastechfest.eventbrite.com - the cost is $50

    Nandri

    SreenivasaRagavan.

    PRISM 2.0

    Composite Application Guidance for WPF and Silverlight- Feb 2009.

    image

    PRISM ?

    PRISM is the code name for the Composite Application Guidance for WPF and Silverlight is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) and Silverlight client applications.

    http://www.microsoft.com/downloads/details.aspx?FamilyID=fa07e1ce-ca3f-4b9b-a21b-e3fa10d013dd&DisplayLang=en

    Nandri

    Sreenivasaragavan.

    What is new in ASP.NET 4.0

    image

    Microsoft ASP.NET 4.0  What is Next? 

    http://videos.visitmix.com/MIX09/T46F

    Nandri

    SreenivasaRagavan.

    Thursday, March 26, 2009

    Data Validation On SilverLight 3.0

    Silverlight supports data validation in TwoWay bindings for target-to-source updates.  To setting the following two properties ValidatesOnExceptions=True,NotifyOnValidationError=True  to True we can receive  Error Notification from Binding engine. 

    Note:  Siliverlight throws Exception in two cases 

    1.  Exceptions thrown from the binding engine's type converter.
    2. Exceptions thrown from the binding object's set accessor.

    Setting ValidatesOnExceptions to true tells the binding engine to create a validation error when an exception occurs.

    Setting NotifyOnValidationError to true tells the binding engine to raise the BindingValidationError event when a validation error occurs and resolves.

    The BindingValidationError event is a routed event, so if you do not handle it on the element that raised the event, it will continue to bubble up until it is handled.

    Here is sample Program.  Here i going to build a small data entry form which requires user to enter  Name , Age, Email and Phone.  in this  Data entry form I am setting Name,Email, age are  Required fields and   Age is numeric if you enter more than 100 it will throw an Expectation saying Invalid Input. No validation set on Phone Property . all the above mentioned  properties makes a class called Contacts  as shown below.

     image

    image

    Now i am Initializing the Contacts class properties with the following values as shown.

    image

    All Inputs field has valid data.

    image

    This form shows Name can not be empty.

    image

    This Data entry form shows  Age can not be more than 100 .

    image

    Nandri

    SreenivasaRagavan.

    Tuesday, March 24, 2009

    Network Status Detection API in SilverLight 3.0

    In .NET Framework 2.0 we are able to detect the network status using  System.Net.NetworkInformation API. Now we can use this same feature in Silverlight 3.0

    The Namespace  System.Net.NetworkInformation has the class name called  NetworkChange  this class has one event called  NetworkAddressChanged  using this even we are able to detect network status . Now i am going to write small Silverlight App which will show how to use NetworkChange   and NetworkAddressChanged.   event.

    Again you can write simple application to demonstrate but i wanted to use some of the other new features of SilverLight 3.0  like  Effects , Projection 

    In my blog i put lot of pictures because  One Picture == 1000 words ( so that we can C# ( see sharp)).

    image

    Here is the XAML UI code and  Code behind Logic .

    image

    image

    image

     

    image

     

    Nandri

    SreenivasaRagavan,

    Pex – Automated White Box Testing for .NET

    Pex (Program EXploration) is an intelligent assistant to the programmer. From a parameterized unit test, it automatically produces a traditional unit test suite with high code coverage. In addition, it suggests to the programmer how to fix the bugs.

    Pex

    Point your IE browser to http://msdn.microsoft.com/en-us/devlabs/cc950525.aspx to download, Install and Evaluate .

    Nandri

    SreenivasaRagavan.

    Monday, March 23, 2009

    MSR – Microsoft Research [DevLabs]

    Code Contracts

    Code Contracts are static library methods used from any .NET program to specify the code’s behavior. Runtime checking and static checking tools are both provided for taking advantage of contracts.

    Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. We currently provide two tools:

    • Runtime Checking. Our binary rewriter modifies a program by injecting the contracts, which are checked as part of program execution. Rewritten programs improve testability: each contract acts as an oracle, giving a test run a pass/fail indication. Automatic testing tools, such as Pex, take advantage of contracts to generate more meaningful unit tests by filtering out meaningless test arguments that don't satisfy the pre-conditions.
    • Static Checking. Our static checker can decide if there are any contract violations without even running the program! It checks for implicit contracts, such as null dereferences and array bounds, as well as the explicit contracts.

    [Source : Microsoft]

    Code Contracts

    Here is the link to know more about  Code Contracts  http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx

     

    Nandri

    SreenivasaRagavan

    Know your Value !!!!!!!!!!

    A well-known speaker started off his seminar by holding up a Rupee 500 [Indian Currency] note.
    In the room of 200 people, he asked, "Who would like this Rupee 500 note?"

     

    image


    Hands are started going up. He said, "I am going to give this note to one of you but first let me do this." He proceeded to crumple the note up. He then asked, "Who still wants it? Still the hands were up in the air.


    "Well," he replied, "What if I do this?" And he dropped it on the ground and started to grind it into the floor with his shoe. He picked it up, now all crumpled and dirty. "Now who still wants it?" Still the hands went into the air.
    "My friends, you have all learned a very valuable lesson. No matter what I did to the money, you still wanted it because it did not decrease in value. It was still worth Rupee 500/-.


    Many times in our lives, we are dropped, crumpled, and ground into the dirt by the decisions we make or some one will Rate our skills or work experience etc.. and the circumstances that come our way. You may feel as though you are worthless! But no matter what has happened or what will happen, you will never lose your value.


    You are special. Don't ever forget it! Never let yesterday's disappointments overshadow tomorrow's dreams.

    [source :Sheo Narayan]

    Thanks

    SreenivasaRagavan

    Sunday, March 22, 2009

    Projection in Silverlight 3.0

    In Silverlight 3.0 we can able to produce 3D effects  using new feature called Projection. Now the UIElement has a new property called Projection .

    Here is the Example how to use this new feature.

    image

    The above XAML code  the  Image Element  uses PlaneProjection  and also i used another new feature called  Element to Element binding to bind the Value of Slider to PlaneProjection property RotationY and Text property  of  TextBlcok .

    While running this application change the slider to new position the current  value of Slider control will updated in TexBlcok and  angle RotationY in PlaneProjection. here are the screenshots in different Projection value.

    image image image

    Nandri

    Sreenivasaragavan.

    New Controls in Silverlight 3.0 beta

    Here i have highlighted some of the new controls which is part of  Silverlight 3.0.  I think in future most of the web apps will be light up with Silverlight.  Look like Flash going to lose Action soon( Remember it uses Action Script).

    image

    Nandri

    SreenivasaRagavan

    Thursday, March 19, 2009

    Element to Element Data Binding – Silverlight 3.0

    In Silverlight 3.0 beta we can bind a value of one control to other Silverlight control . for example  here i am going to choose two elements   TextBlock and Slider Control.  Now I am going to bind Value of Slider Control to TextBlock Text property with out writing  single line of code.

    In SilverLight 2.0 we write code  behind to update the TextBlock  text property  when the slider ValueChange event occur .

    image

    This is GUI for above XAML CODE.

    image

    Text="{Binding ElementName=slider, Path=Value, Mode=OneWay}"  // The Binding mode i am using One-way because my Binding control is TextBlock (Read-only)

    we can also specify Mode =TwoWay in that case  we need use TextBox instead of TextBlock.  Now if you input any integer value in TextBox same time First Element Slider Control also slide to same position as the value imputed in TextBox.

    image

    Now Run the application and Move the slider same time  Second Element  TextBlock Control Text will be updated based on slider position value as shown below .

    image

    image

    Nandri

    SreenivasaRagavan.

    Wednesday, March 18, 2009

    Silverlight 3.0 Out-Of-Browser Application

    With Silverlight 3.0 now we can run any Silverlight Application we can run as Desktop Application that means Running a SL 3.0 apps out side the IE Browser.  The good things that this feature added to SL.3.0  with no additional download any plug-in and also this feature work in Cross platform  Windows and MAC.

    Let see how we can enable this feature.

    1) Create a Silverlight 3.0 Application

    2) Change the AppManifest.xml as shown below.

    <Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    >
        <Deployment.Parts>
        </Deployment.Parts>

      <!--Uncomment the markup and update the fields below to make your application offline enabled-->
        <Deployment.ApplicationIdentity>
            <ApplicationIdentity 
                ShortName="Out of Browser Silverlight Application"
                Title="Sreeni Silverlight Application ">
                <ApplicationIdentity.Blurb>Description of your Silverlight application</ApplicationIdentity.Blurb>
            </ApplicationIdentity>
        </Deployment.ApplicationIdentity>
    </Deployment>

    After enabling the above Lines  on  AppManifest.xml file run the application and right click you get the context menu as shown in below screenshot.

    image

    When you select Install Out of Browser Silverlight ..On this computer option  you get the following dialog box

    image

    This below screenshot shows  SL 3.0 Application Runs out of browser application ( Local host)

     

    image

    I choose Install on Desktop so  my SL 3.0 application  installed on my DESKTOP  now you can see last desktop ICON in below screenshot  

    image

    Now your right click on running Application you will get Different Context menu saying  Remove this Application. 

    image

    NOTE: this same feature  you can enable via Programming .

    Nandri

    SreenivasaRagavan.

    Silver Light 3.0 Beta 1 for VS.NET 2008 Available for Download

    Download the Silverlight 3.0 and light up the Web and Business.

    SL 3.0 Runtime 

     http://go.microsoft.com/fwlink/?linkid=143433

    VS.NET 2008  SP1 Tools

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=11dc7151-dbd6-4e39-878f-5081863cbb5d

    SDK

    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=d09b6ecf-9a45-4d99-b752-2a330a937bc4!

    SDK Installation

    image

     

    image

    Nandri

    SreenivasaRagavan.

    Updated Windows Azure SDKs and Visual Studio Tools Now Available‏

    Install both the Windows Azure Tools for Visual Studio and SDK: http://go.microsoft.com/fwlink/?LinkId=128752

    What’s new in Windows Azure SDK
    • Support for developing Managed Full Trust applications. It also provides support for Native Code via PInvokes and spawning native processes.
    • Support for developing FastCGI applications, including support for rewrite rules via URL Rewrite Module.
    • Improved support for the integration of development storage with Visual Studio, including enhanced performance and support for SQL Server (only local instance).
    What’s new in Windows Azure Tools for Microsoft Visual Studio
    • Combined installer includes the Windows Azure SDK
    • Addressed top customer bugs
    • Native Code Debugging
    • Update Notification of future releases
    • FastCGI template

    Nandri

    SreenivasaRagavan.

    Saturday, March 14, 2009

    Thursday, March 12, 2009

    Message Correlation In BizTalk 2006 /2009

    What is Correlation?

    Suppose let say Microsoft asked HITACHI CONSULTING to host a Hands on training events for Developing an Applications on Windows AZURE Platform. In this case HITACHI CONSULTING will send out an Invitation to the developers nationwide at the same time HITACHI CONUSLTING wants to know how may people will be to attending this events so that they can arrange all facilities for all attendees . To find out number of attendees for this events HITACHI CONSULTING  will match the all of these responses to the Invitation they sent out this is called  Correlation.

    Now let see how we can achieve this process using BizTalk Solution.  We will use BizTalk Orchestration to define the process and we define the  Invitation as BizTalk XSD Schema. When we send Initiation we also send Unique reference number the same way the response also should have this reference number this help us to match the request to the response.

    For a Invitation that is sent in an orchestration instance we have to define in the orchestration which part of the message correlates the request.  The response to this Invitation should also specify this same reference number, this will allow us to easily match the request to the response. In BizTalk  correlation type is simply a collection of one or more properties that uniquely identify a request and matching response.

    Steps needed to implement this Business process in BIZTALK 2009( i am using 2009 you can also use 2004 , 2006).

    1) Define a Invitation Message  as  BizTalk XSD Schema .

    2) Create a Property schema with Invitation Ref Number as promoted filed .

    3) Create  and Configure Orchestration with Receive and Send ports.

    4) Create Correlation type and set.

    5) Deploy the solution and test it.

    Create the Invitation Schema with following attribute . In this Schema InviteRefNumber is Uniquely indentify a attendee.

    image

    When we wanted to access a message property inside  BizTalk Orchestration we need to promote that particularly property that is called Message Context .  this can be done with special kind of schema called  Property Schema . in this above schema we are going to promote InviteRefNumber once we are done that we can define correlation type.

    Add new Property Schema as shown below.

    image

    Promote the InviteRefNumber field.

    image

       Creating a Business process as BizTalk Orchestration and define the message type , ports and correlation type and sets.

    image 

      image

    Now deploy the BizTalk solution and configure Receive , send ports and Orchestration.  Before that do not forgot to add  SN Key ( strong name key ) file to the BizTalk project. because this BizTalk solution will deployed in GAC

    GAC – Global Assembly Cache.

      After configuring  BizTalk solution using BizTalk Admin console .  drop the  Invite message in In Folder  you will see ASAP the BizTalk process picked of the message and send to Out Folder.  now if you query the  message Instances you will see the Orchestration instance status is Dehydrated that means it persisted in BizTalk message box and waiting for response message to arrive.

    image

    Now you copy the message from OUT folder and  paste into  IN1 ( folder ) then query the  Service Instance you wont find in BizTalk Message DB  this is called Hydrated that means  the persisted Orchestration instance is processed by the corresponding  correlated Response  message .

    image

    Nandri

    Sreenivasaragavan.

    [Success is the result of your action –BABA]

    Wednesday, March 11, 2009

    Microsoft SQL Data Services.

    Microsoft SQL Data Services  known as  SDS its part of the  Windows Azure Platform. SDS are highly scalable and its built on Microsoft SQL Server and Windows Server Technology.  SDS provides industry standard  protocol such as SOAP and REST way to Program and query the data.

    image

    SDS data model is three level of containment model that is known as  ACE .

    A- Authority  , C – Container , E- Entity.

    image

    Authority :

    Authority is the top level  of this Three level containment. An authority is represented by a DNS name for example  sreenicontact.data.database.windows.net where sreenicontact is an authority and data.database.windows.net refers to the service. You can create more than one authority  The DNS name of an authority resolves to an IP address that maps to a specific data center.

    Container :

    Authority is a collection of containers.  A single authority can have zero or more containers Each containers have unique Id within authority. containers stores entity this is noting but Data. Containers can have  zero or more entities.

    Entities :

    Each entity inside a container can store any number of user-defined properties and corresponding values. for example i can store the following entity model in a container. 

    image

    Right now the following Data types are supported by  SDS. when you create a  XML payload either using  SOAP or REST.

    • string
    • base64Binary
    • boolean
    • decimal
    • dateTime

    By default all the Entity has the following fixed set  of metadata properties.  Id, Version , Kind.

    Id – This  properties uniquely  identifies a flexible entity .

    Version – This property value is assigned by system when ever any entity is created.  current date time value will be assigned .

    Kind –This property values  is user defined Identifiers to identifies entity  type ( for example  HContact,  Employee, Orders etc..);

    Now let us Access SDS via programming to do create  Authority , Container and  Entity  after that  we will store and query the data as well.

    I am going to use SOAP based API to  program against  SQL Data Service . Here is the  URL  for SOAP format to access SDS.

    https://data.database.windows.net/soap/v1/mex.   Here i am going to create simple  C# console application . First we need to add Service reference to  the console application.

    image

    After adding SDS service reference you can see the list of  operations.

    image

    Now we need to create a methods for to  Create Authority , Container , Entity and store and Query the SDS data.

    Please make sure that you provide  small case letter for authority id

    private static string authority="sreenicontact";

    private static string container = "contact";

    image 

     

    image

    Now Call the above created the function in main program and  store some data in above created Entity.

    image

    Here is output of the above Query [ from e in entities select e"]

    image

    Nandri

    Sreenivasaragavan