Tuesday, December 8, 2009

SilverLight 4.0 Mouse Wheel Event

 

Today I downloaded and Installed SL 4.0 Beta SDK on my Windows 64 bit Machine. There are many new features added to it,but i wanted to try simple one and see how this works. so In this Blog post i am going to show sliverlight 4.0 new mouse wheel event.

image

1) First Download and Install SilverLight 4.0 Beta SDK. you can download  SL 4.0 SDK from http://silverlight.net/getstarted/silverlight-4-beta/ 

After installing first create Silverlight 4.0 project in VS.NET 2010 Beta 2

image

Make sure that you select Silverlight version 4.0 from dropdown list.

 

image

Here i am going to create simple UI which has one  </TextBlock> with some text . Now i am going to write code for TextBlock MouseWheelEvent.

image

image

In MouseWheelEvent args we could  capture the delta (change) value  and assign to  TextBlock FontSize property. so that when you scroll mouse ball up and down the text on the </TextBlock> UI Element will change as well.

 

UI – Before MouseWheelEvent

image

UI-After MouseWheelEvent.

image

Nandri(Thanks)

SreenivasaRagavan.

Thursday, December 3, 2009

WCF Duplex HttpBinding [Polling] In Silverlight 3.0

In Silverlight HTTP polling duplex binding protocol has been designed to enable data push from the WCF  server to the client.  Now In this blog post i am going to show you how we can use WCF Duplex Http Binding to push data from server to client.  I am using  VS.NET 2010 Beta 2.  you can also use VS.NET 2008 SP1 with Siliverlight 3.0 SDK Installed

1) First Create Silver application project 

image

Make sure that you select Silverlight version 3.0 and also check to create Sliverlight Host application project as well.

image

After creating the project now right click on Silverlight web application project select add new item and add the Siliverlight-Enabled WCF Service Template.

image

After that we need to add two references one on server project where the WCF services added other one in Silverlight client project.

 

Server Side Library  ( Located in C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Libraries\Server)

image

Client Side Library (C:\Program Files (x86)\Microsoft SDKs\Silverlight\v3.0\Libraries\Client)

image

Now we need to add Client Callback contract Interface as shown below in WCF service side and make sure that the operation contract decorated with IsOneWay=true.

[ServiceContract]
  public interface IDuplexClientCallBack
  {
      [OperationContract(IsOneWay = true)]
      void GetServerTime(string serverTime);
  }

image

after completing the service implementation now time to change Web.config 

 

image

Save the Web.config file now we are ready to browse the  WCF Service in a Browser . The following screen shows that we are successfully created the WCF Duplex Service.

image

Now we need to add WCF service reference to Silverlight client 

image

image

In Silverlight all service calls are made as Asynchronous calls. if you look at the above client side code we have event handler for GetCurrentServerTimeAsync() method.

Now run the client you will see there is callback to Silverlight client from WCF service which will update the time every 5 seconds.

 image

Using WCF Polling Duplex Http binding i have created small apps which will updates Cricket Score every 1 min  from 3rd party website. this URL of the game is configurable like that you can even use it for stock quote update.

Nandri(Thanks)

SreenivasaRagavan.

Thursday, November 26, 2009

Installing & Configuring App Fabric Beta (Dublin)

App Fabric formerly knows as Dublin.  You can download from

http://www.microsoft.com/downloads/details.aspx?FamilyID=0bd0b14f-d112-4f11-94bf-90b489622edd&displaylang=en

Windows Server AppFabric is a set of integrated technologies that make it easier to build, scale and manage Web and composite applications that run on IIS. Windows Server AppFabric targets applications built using ASP.NET, Windows Communication Foundation (WCF), and Windows Workflow Foundation (WF).

image

image

image

image

image

In the above screen we need to provide check create new Cluster and provide network file path where you wanted to store configuration .

image

for me the last Distributed Cache Configuration failed . please let me know if you got it installed i did tried other options like giving permission to network file share etc.

After installing the following services added to Internet Information Services Manager. 

image

Now double click Monitoring Database and right click on connection string and click Initialize DB this will create Monitoring DB in SQL server Express.

image

image

Now my next step is to develop some WF services and deploy it to App Fabric and see . Stay Tuned ….

 

Nandri (Thanks)

SreenivasaRagavan.

Wednesday, November 25, 2009

SharePoint Designer 2010 (SPD)

I Think MS Engineers can bring life to any type of broken Bulb.  why i am saying is  FrontPage –>SPD 2007 now  SPD version 2010 really rocks . I Installed today and did play with it and liked it .

image

In first page they have clearly separated the site view .

image

After opening the site

image

Nandri(Thanks)

Sreenivasaragavan.

Tuesday, November 24, 2009

Creating & Deploying SharePoint 2010 Standard WebPart using VS.NET 2010

 

In SharePoint 2010 we have two types of web parts one is Visual WebPart another one is Standard WebPart. Visual WebPart is nothing .ascx controls where you can create WebPart with ASP.NET UI Controls where as Standard WebPart is Class Library in which we create UI programmatically.  VS.NET 2010 fully Integrated with SharePoint 2010 so now creating and deploying is very easy.

In this Blog post i am going to created SharePoint standard Connectable WebPart. Connectable Web part means two web part can communicate each other.

Here are the steps involved creating Connectable Web Parts.

1) First we need to Define the  Interface which specify the data we wanted to pass between web parts.

2) Implement the interface.

3) Create Provider Web Part ( which returns the Reference to the Interface) property  should be decorated with ConnectionProvider attribute.

4) Create Consumer Web Part It should contain the method which would receive the interface and decorated with ConnectionConsumer attribute.

5) Build and Deploy and Test it.

What will my Connectable Web Parts will do?

Basically my Provider Web Part will have Dropdown list which is populated with Account Numbers from Adventureworks SQL Sample Database and the  consumer Web Part will display Account Details for the selected account from Dropdown List.  

image

First Create Empty SharePoint Project and name it what ever name you want.

image

  Next we need to add Interface to our project.  here is my Interface definition

namespace SreeniDBWebpart
{
    public  interface IGetRecords
    {
        string GetId { get; }
    }
}

 

Now create Provider WebPart and Implement the  IGetRecrods Interface.

image

ProviderWebPart

image

Consumer WebPart

image 






Now build and Deploy the project . At this point our Web Parts are deployed into SharePoint and ready to use in any SharePoint WebPart Page.



image



Now to go to SharePoint Click Site Actions->More Options and Create new WebPart Page



image



image



Now Add Provider & Consumer Web Parts into newly created Web Part page .



image



 



Note: When Connecting to SQL DB I directly create the connection and Issued the SQL Command,  this is for Demo purpose only . But you can use LINQ to SQL  or EF 4.0 or you can use Existing Data Layer which you created that talks to DB.



Nandri(Thanks)



SreenivasaRagavan.

Saturday, November 21, 2009

Creating SharePoint Web Parts using VS.NET 2010 Beta 2

 

1) First Create new Visual Web Part project .

image

Next point to this project solution to SharePoint site where you want to deploy this Visual Web Part. When you click Finish this time VS.NET  validates the

SharePoint URL you are provided . In my case  this is the SharePoint site i wanted to deploy this visual web part. http://win-m2ircoq6iqa:44119/Family/

image

Now we can place Controls from Toolbox or even we can type HTML Files in  Source code Window.

image

Once you Build your web part Right click on the solution and Click the Deploy Solution. Now VS.NET Compiles it and Package it and deploy as well.

image   

Now Click Edit ICON and click web part Ribbon and add our custom Visual web part to our site.

image 

image

Click Insert –> click web part->select Custom Folder->Select our Visual Web parts  and then Click it will add our Visual Web parts to our Site.

image

 

Nandri(Thanks)

SreenivasaRagavan.

Saturday, November 14, 2009

Sachin Tendulkar –2 Decades still Running

Does not matter which field you are in I wish you can always contribute to the country  you  were born. 

image

Nandri(Thanks)

SreenivasaRagavan.

Monday, November 9, 2009

Assembly Caching in Silverlight project.

Assembly Caching is the project Deployment technique this allows us to separate dependent assemblies  from XAP file and deploy the dependent assemblies as ZIP files.

image

The advantage of the assembly caching is to reduce application startup time and clients to keep the cached copies of the frequently use assemblies.

You can enable assembly caching just checking the option Reduce XAP size by using application library caching.   When you compile Silverlight project this is options is not set by default.

image

After enabling this option recompile the project  your will see ZIP for files each cacheable assembly as shown below.

image

Nandri(Thanks)

Sreenivasa Ragavan.

Tuesday, October 27, 2009

WF 4.0 calling WCF service 4.0 [ VS.NET 2010 Beta 2]

I downloaded VS.NET 2010 Beta 2 a week ago. But today only i got some free time to install, now i wanted to try new WF /WCF 4.0 .

In this blog i am going to explore WF 4.0 calling WCF 4.0 .

Step1 : Create a WCF service.

Here is my service contract definition and implementation

[ServiceContract(Name="SreeniService")]
  public interface IServiceContract
  {

      [OperationContract]
      DateTime GetServerTime();
      [OperationContract]
      string Greet(string Name);

  }

public class SreeniSvc : IServiceContract
  {

     #region IServiceContract Members

      public DateTime GetServerTime()
      {
          return DateTime.Now;
      }

      public string Greet(string Name)
      {
          return "Welcome Mr. "+ Name ;
      }

      #endregion
  }

Step 2: Add new WF project to the existing WCF service project.

Step 3:  Add WCF service Reference  to WF project.

After adding the Service Reference you must build or compile the project then only All methods or Operations in WCF service will appear as  WF activities in the Tool Box as shown below.

  image

Now we need to drag and drop the image  Sequence activity first to the WF designer surface. because we are going to build workflow using more then one activity . otherwise we will able to drop only one activity in the WF designer surface .

After that Drag and drop the  WCF operation Activity  GetServerTime on top of the Sequence activity from the Tool Box. This operation returns Datetime so we need to create a variable with this type and assign to this Activity. to crate variable just click Create Variable and choose variable type , Scope and even you can provide default Value .

   image

image 

Now we need to print the  GetServerTime Operations Result to the console. To do that we are going to use WriteLine activity from the Tool box and set the Expression as shown below.

image

Follow the same steps for the Second Operation Greet once you are finished  your workflow should look like this.

image 

Now execute the WF project Ctrl+F5 you should see the result as shown below.

image

 

Nandri(Thanks)

Sreenivasa Ragavan.

Friday, October 23, 2009

Windows 7 is Heaven

image

Nandri(Thanks)

SeenivasaRagavan.

Tuesday, October 20, 2009

Visual Studio 2010 and .NET Framework 4 Beta 2 availability

 

Visual Studio

Visual Studio 2010 Beta 2 out today for MSDN Subscribers!

Visual Studio 2010 Beta 2 is now available for MSDN subscribers to download. General availability will be oct 21. 
Click here  for download Visual Studio 2010 page for Beta 2 general availability .,

Nandri (Thanks)

SeenivasaRagavan.

Thursday, October 8, 2009

My Windows 7 WEI Score [ Widows Experience Index]

Please let me know your WEI Score.

image 

Nandri(Thanks)

SreenivasaRagavan

Saturday, September 26, 2009

Windows-7 for Students - $29.99

Please share with your friends when you see this Blog.

http://www.win741.com/

Nandri(Thanks)

Sreenivasa Ragavan

Web Application Tool Kit Gallery

MS Announced Web Application Took kit here is the Link where you can download the kits .

image

http://code.msdn.microsoft.com/Project/ProjectDirectory.aspx?TagName=WebAppToolkits

Nandri(Thanks)

Sreenivasa Ragavan.

Thursday, September 10, 2009

ADO.NET Data Services – Server Driven Paging (SDP).

In this post I am going to extend from my previous Post http://mstecharchitect.blogspot.com/2009/09/adonet-data-services-projections.html. In this post we are going to see how we can limit the query result with new  Server Driven Paging .

When you browse the .Svc file  the Services returns all the  records from the Contact Entity set as shown below. we may not need all the Records at once on the client side.

image

Now we are going to limit this result using  ADO.NT Data Service  SDP feature called Server Driven Paging. To enable this we need to make small code change as shown below.

The line config.SetEntitySetPageSize("*", 3); will do the magic.

image 

Now we asked server to return only 3 records. The below screenshot shows the result and also it provides the Link for next Page . 

image

Suppose if we want to know total records we need to use $inlinecount operation. http://localhost:2600/AW.svc/Contact?$inlinecount=allpages

image

Thanks(Nandri)

SreenivasaRagavan

Monday, September 7, 2009

ADO.NET Data Services – Projections[$select query option]

The ADO.NET Data Services Projection feature allows client to query subset of properties of Entity Set. This feature helps to optimize client applications  bandwidth consumption and memory footprint. ADO.NET Data Services URI format by adding the $select query option to enable clients to explicitly define the properties to be returned.

Let’s see this in action.  First download & Installed  ADO.NET Data Services v1.5 CTP2.  Download @  http://www.microsoft.com/downloads/details.aspx?FamilyID=a71060eb-454e-4475-81a6-e9552b1034fc&displaylang=en

1) First Create ASP.NET Web Application Project.

2) Add ADO.NET Entity Data Model Template to the project. and follow the Wizard  and create our Entity Model which we are going to expose as a Service.

Here i am going to choose Adventure Works Database Contact Table as my Data source. image

 image 

 

 

3) Now we need to Add ADO.NET Data Service V1.5 CTP2 template 

image

4) Now we need make  changes to  the  .SVC  as shown below. And browse the .Svc in browser

image

Here is the screenshot shows our ADO.NET service is Up and Running with Contact Entity set. 

image

when you browse the following http://localhost:1888/AW.svc/Contact URL you get all Records with all properties of the contact Entity set as shown below.

image 

Now we are coming actual part of this Blog post. Now let’s use projection feature to query Contact Entity Set  FirstName, LastName &EmailAddress Properties.

Here is the URI format http://localhost:1888/AW.svc/Contact?$select=FirstName,LastName,EmailAddress and the result of the this query is

image

Thanks(Nandri)

SreenivasaRagavan.