Latest Entries »

With silverlight 3 we were able to validate data using ‘INotifyPropertyChanged’  (System.ComponenetModel.INotifyPropertyChanged) interface.

Now in silverlight 4 we have one new interface called ‘INotifyDataErrorInfo’  (System.ComponenetModel.INotifyDataErrorInfo) as well.

 

Any Entity class can implement both or any of these interfaces to validate the data.

I am using the Entity class “User” to validate the data (Name and Email) as shown in the image below……

Here “Name” is validating through “INotifyDataErrorInfo” and “Email” is validating through “INotifyPropertyChanged”.

Validation using “INotifyPropertyChanged” :

To use “INotifyPropertyChanged”, we need to implement one event “PropertyChanged” in code behind file as shown in the image above (second image in the post).

We also need to set couple of attributes (“ValidatesOnExceptions”, “NotifyOnValidationError”) on the control in XAML code which actually performs the validation as shown in the image below……

Now when the value of property “email” is changed, code in the following image throws an exception…..

And this exception is then handled by silverlight validation framework and it creates the error visualization on silverlight control as shown in the folowing image…….

Validation using “INotifyDataErrorInfo” :

To use “INotifyDataErrorInfo” we need to implement one event “ErrorsChanged”, one method “GetErrors” and one property “HasErrors” in the code behind file as shown in the image above (second image in the current blog post).

Here we do not need to implement anything in XAML code to perform validation as in case of “INotifyPropertyChanged”.

Now when the value of property “name” is changed, code in the following image validates the value of “name” and called the event “ErrorsChanged” and which in turns called the method “GetErrors()” which returns the “errors” (or null if there is no error) as shown in the image below…….

And then if “GetError()” method returns any error is then handled by silverlight validation framework and it creates the error visualization on silverlight control as shown in the folowing image…….

Silverlight validation framework seems lot more sound with silverlight 4 now in compare with silverlight 3. Silverlight 4 validation framework also supports “Asynchronous Data Validation”, which I will discuss in my next silverlight blog post.

 For more info on silverlight, just go to, http://www.silverlight.net

For more on silverlight 4, click here, http://www.silverlight.net/getstarted/silverlight-4/

For more details on Silverlight 4.0, you can also browse through following blogs………

http://timheuer.com/blog/          —  Tim Heuer Blog – Silverlight Program Manager

http://blogs.silverlight.net/blogs/jesseliberty/       — Jesse Liberty Blog – Silverlight Program Manager

http://johnpapa.net/              —  John Papa website

http://adamkinney.wordpress.com/          — Adam Kinney Blog — For Silverlight graphics, interface and Expression Blend

Currently I am working on a sample project in .net 4.0 and in which I am using Entity Model to expose my Data from SQL Server 2008 database.
Now I am also using POCO entities as in .Net 4.0 POCO entities gives us better control over the entities we are using to map with the entities in the Entity Model compare to the auto generated entities generated by Entity Model itself.
Now here are my two POCO entities ‘User’ and ‘Account’….

Click the image for full view…….

Now I am querying data from SQL using LINQ to SQL as shown below in code…….

This code should return the ‘Account’ with users in it but instead it returns no data in browser or no Error/ Exception as well but simply shows “Webpage can’t be displayed” in IE8 as shown in the image below…..

Now I just tried to figure out the issue but not found anything as there was no error or Exception in the code and the only symptom of this issue was that when I was debugging the code it comes to the debug point twice in the method where I am using LINQ to SQL. The good thing was it was showing the correct results inside the variable ‘accountList’ but was not showing any result in the browser.

Then I suddenly notice that my ‘Account’ entity has the property ‘Users’ of type [List of ‘User’] (Angle brackets not allowed here) and then again each User has the property ‘Account’ and again each ‘Account’ has List and seems like infinite dependency on each other….

So what I tried for the solution was, I just added the attribute [IgnoreDataMember] (using System.Runtime.Serialization assembly) on ‘Account’ property in my ‘User’ entity class as shown below in image……..

And tested it again…. and guess what…. Bingoooo…. It just simply works and now browser shows the correct data as shown in image below……

Click the image for full view…….

So what I guess is that it was happening because of kind of infinite circular dependency created by data model I am using.

(If I am not using extention method ‘Include()’ in my LINQ to SQL, it works just fine and returns the Accounts without ‘Users’ off course)

But the question that still remains is, it’s the known issue or the unexplored bug of using LINQ to SQL with POCO entities.

In my last blog on Telerik’s Gridview Control, I just discussed couple of issues, I was encountered while using Telerik’s GridView.

Telerik’s Grid View control usually comes without any hierarchy by default like in the following image……..

Click the image for full view……

In my this blog post I will explain that how we can extend Telerik’s Grid View control for multiple hierarchy.

It’s required when you need to achive multiple hierarchy in Grid View like following image……..

Click the image for full view……

So first of all I will show that how can this Grid View control can be extende using simle XAML code and then I will move to c# code for Grid View extention.

XAML code to extend GridView control for multiple hierarchy using GridView Table Definition : (It creates another grid view inside one grid view)

This simple XAML code creates the one Grid View inside the another just shown as in image above……
But what if My need is to create say 10 hierarchycal Grid Views… And here the code behind comes to make the solution easy.

C# code for extending GridView control for multiple hierarchy: (with this code you can create 10 grid views – one inside another but off course you can create like infinite grid views by increasing the value from 10)

This code can create the Grid View as shown in the figure below……..

Click the image for full view……

So you have seen that it’s just so easy to extend Telerik’s GridView control for multiple hierarchy.

In my next blog on Telerik’s Grid View, I will show you that how we can dynamically add the design elements(Controls) in the ‘RowDetailsTemplate’ of Telerik’s Grid View Control and make it more useful.

For more information on Telerik’s Silverlight RadGridView control please browse to, http://www.telerik.com/products/silverlight/gridview.aspx

I am using ADO.Net Enity Framework 4.0 in my current sample learning project (WCF REST Service Application) and I am also using POCO entities to map objects that are in Entity Model.

As I am working with N-tier architecture, I am having my POCO entities, Entity Model and my executable service page(start up page) in separate projects. My ObjectContext class (for mapping entities in entity model and POCO entities) is in project with POCO entities.

Issue :
Now as I tried to run my service project and navigate to “http://localhost/PronerveEPMS/PronerveRestService/Accounts” for getting all “Accounts” in my database, my code raised the Exception “The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.”. See the figure below……..

Click the image for full view

Solution :
Now the issue was my connection string of Entity Model was in app.config file(by default) with Entity Model and so when I was executing my service project it used to search connection string in web.config file of service project and so not found it.
And so as a solution i just put my default connection string of Entity Model in web.config of service project and also need to add reference of the project containing Entity Model in executable service project.

ok, now searching for the solution to this issue I found that many developers were searching for the exact connection string to use with entity model and so here is my connection string….

<add name="pronerveEntities"
connectionString="metadata=res://pronerve.data.sql/pronerve.csdl|
res://pronerve.data.sql/pronerve.ssdl|
res://pronerve.data.sql/pronerve.msl;
provider=System.Data.SqlClient;
provider connection string=’Data Source=NIKHILTHAKER-PC;
Initial Catalog=pronerve;
User ID=sa;
Password=xyz;
MultipleActiveResultSets=True’;”
providerName=”System.Data.EntityClient” />

Here “metadata” part of the connection string points to the auto generated csdl, ssdl, msl files which contains the schema and other information about the database used by Entity Model.

Second thing is ‘pronerve.data.sql’ (bold sections in connection string), which is the name of my project that contains Entity Model, can be replaced by simple ‘*’ but it is always reccomended that you always use the proper assembly name in such scenarios. For more details on this, just go to here… http://msdn.microsoft.com/en-us/library/cc716756.aspx

For more on ADO.Net Entity Framework please go to, http://msdn.microsoft.com/en-us/data/aa937723.aspx

I will also talk more about POCO entities in .Net 4.0 in some other blog.

For last 3-4 days I am trying to understand the RESTful architecture for applications.
And so for start I have created a sample REST service using “WCF REST Service Application” template in Visual Studio 2010 RC and .Net Framework 4.

At first I have tested service operations of my REST service with ‘GET’ & ‘POST’ and they were working absolutely OK.
(I have not created any client yet to test my RESTful service but I am using ‘Fiddler‘ for the purpose.)

Now when I have started testing with ‘PUT’ verb in my request to REST service through fiddler, it has returned Http Error 405 (‘Method not Allowed’).
Then I started testing ‘DELETE’ and it was also not working with the same Http Error 405.

As I am like newbie to REST Services and IIS stuff and all that, I have not understand the error described in Image above.
So I have googled this Error a lot but not found the appropriate answer and so ultimately put the question on official IIS forum as I have found by the time that, this Error is related to IIS……

Link to IIS Forum My thread ==> http://forums.iis.net/t/1166025.aspx

And Bingo……. I got the answer from the forum so quickly and that just simply worked.

The issue was WEB DAV module on IIS was throwing the Http Error 405 as it was claiming to process the request sent by my application on IIS, but my application is not configured to process it with WEB DAV module which do not support ‘PUT’ and ‘DELETE’ verbs by default.

So as a solution I have just removed WEB DAV module from my IIS 7…….
Go to IIS Manager ==> Default Web Site ==> MyRESTApplication ==> Modules(In Features View) ==> WEB DAV Module (On module right click) ==> Remove

Now evrything in my RESTful application works just great…

Currently I am working with Telerik’s Silverlight GridView control and while working, I just stuck to some issues which I would like to describe here. I will keep on adding parts in this blog series as I will explore Telerik’s GridView more and more.

Issue 1. How to access standard silverlight controls lying inside Telerik’s RadGridView (infact inside the RowDetailsTemplate of RadGridView) to generate dynamic RowDetailsTemplate for RadGridView
Solution : To access the StackPanel(Standard Silverlight Control) inside the RowDetailsTemplate of the Telerik’s RadGridView we can use “LoadingRowDetails” event of the RadGridView and then we can get the StackPanel using ‘GridViewRowDetailsEventArgs e’ and following c# code…….

StackPanel sp = e.DetailsElement.FindName(“x:NameOfTheStackPanel”);

Issue 2. How to access GridViewColumn of RadgridView programmatically with c# code
Solution :
To access the GridViewColumn of RadGridView we can use the following c# code…….

GridViewColumn gvc = RadGridViewName.Columns[“UniqueNameOfGridViewColumn”];

Telerik’s RadControls for Silverlight are really working great so I suggest,

In part two of this blog series I will discuss how to make telerik’s GridView hirarchical using simle c# code.

Hi guys, if you are a Flash lover then it’s time to breakup now… because when you know the Silverlight 4.0 features in detail you will be definitely fall in love with Silverlight 4.0.

Silverlight 4.0

 Whether you are a flashy designer or developer who likes to design highly interactive games or websites or you are a high level Business Application Developer who needs great hold over the data, Silverlight 4.0 has the treat for both……

  • If you are a flashy website designer then you should get started exploring following new features in Silverlight 4.0 ……….

1.> Right Mouse Click Support

2.> Mouse Wheel Support

3.> Accessing Web Camera and Microphone

4.> Silverlight Controls as Drop Targets – Drag and Drop Support

5.> Hosting HTML Content – Now you can render HTML in Silverlight

6.> Local File Access – File from Local System can be accessed

7.> “RichtextArea” and “ViewBox” Controls

8.> Right to Left Language Support – For Languages like Hebrew and Urdu and lot more…

9.> Programmatically access to Global Clipboard

  • If you are a multitier Business Application Developer with complex architecture, you can start understanding Silverlight 4.0 with following new features……….

1. RIA Services support in Silverlight 4.0 with Visual Studio 2010

2. MEF for Application Extensibility – It’s Managed Extensibility Framework (MEF)

3. Network Authentication and Trusted Network Access

4. COM Object Access in Trusted Applications – Now you can access applications in Local System

5. Asynchronous Data Validations

6. DataGrid Enhancements in Silverlight 4.0

7. Printing APIs

8. Notification API

  • Some of these features are working with “Out Of Browser Applications” developed in Silverlight 4.0.
  • Currently only Silverlight 4.0 Developer Runtime is available.

I have already explored all these features and believe me, Silverlight 4.0 is simply rocking!!!

For more details on Silverlight 4.0 click any of the following links,

http://silverlight.net/getstarted/silverlight-4-beta/                   —  Official Microsoft Silverlight website

http://timheuer.com/blog/          —  Tim Heuer Blog – Silverlight Program Manager

http://blogs.silverlight.net/blogs/jesseliberty/       — Jesse Liberty Blog – Silverlight Program Manager

http://johnpapa.net/              —  John Papa website

http://adamkinney.wordpress.com/          — Adam Kinney Blog — For Silverlight graphics, interface and Expression Blend

 

  • Yes, CYNCZ, the best contact synchronization platform on the web is in its BETA version now.

CYNCZ - Your Contacts Anytime Any Device

With CYNCZ you can synchronize all your contacts, across all your address books you are using to keep connected with your family, friends, colleagues and business contacts.

Currently CYNCZ supports the sync with the address books of Gmail, Hotmail, Yahoo, Blackberry, Windows Mobile and Outlook.

In next couple of weeks CYNCZ may announce the support for the address books of Google Android and Salesforce CRM.

  • Why I am describing the CYNCZ as “One of the best web ideas for the next decade”.

In the world of “www” – web, success of any idea is judged from its current and prospective user base. And CYNCZ is having the world’s maybe the largest prospective user base as shown in the image and statistics below.

Contact Sources for CYNCZ

  • Some interesting statistics on Email, Social Network, CRM, Personal Computer and Smart Phone users across the web, across the globe :
  1. No of Unique Email Users on the web : 1.3 Billion+ (One of every five persons on the earth is using Emails)
  2. No of Email Accounts on the web : 1.4 Billion+
  3. No of Personal Computers in the world : 1 Billion+ ( Interesting fact is world has took 27 years to reach to 1 Billion mark but this number will be doubled in next five years only )
  4. No of Social Network Accounts on the web : 450 Million+ ( Only Facebook is having 250 Million+ Users )
  5. No of CRM Tool Users in the world : 35 Million+
  6. No of Smart Phone Users in the world : 350 Million+ ( In 2009 only 174 million new smart phones were sold )
  • So the each of this account user on the web and each of this device owner in the world is the prospective user of CYNCZ.

((( If you have slightest doubt about the numbers shown here just Google it around and you will know the fact. )))

  • Why the CYNCZ is the best Contact Synchronization Platform on the web?

CYNCZ is offering the features like AutoSync, Rule Based Sync, De-Duping, Rollback, Contact Tagging & lot more……

To have the more proper and appropriate answer, in fact to have more practical answer, to this question simply browse the links given below.

Hi Everyone,

Visual Studio 2010 and .NET Framework 4 Release Candidate is just out on 10th February for public.

Visual Studio 2010 RC Image


Download links for VS2010RC :

  • If you have a download manager that can handle a large file, click here to download the ISO image directly.
  • OR You can download the ISO image in 4 parts from here.

Install and Upgrade Instruction :

1.> You can install VisualStudio2010RC side by side to VisualStudio2008 SP1

2.> You can not install VisualStudio2010RC side by side to VisualStudio2010Beta2

So first uninstall the VisualStudio2010Beta2 and all its components from Uninstall Programs (previously “Add or Remove Programs”) and then only install the VS2010RC.

For more details on downloading Visual Studio 2010 and working with ISOs, go to this link.

For more details on what’s new in Visual Studio 2010 RC, just go to walkthroughs of VS2010RC.