Saturday, May 31, 2008

Accenture awarded “Best Employer” for second straight year...

For the second year in a row, Accenture has received the “Best Employer” Award in Belgium, granted by the Great place to work in Europe with the support of the Vlerick Leuven Gent Management School.

Employees in Belgium once again voted Accenture into the top 10 by completing a survey distributed by the Great Place to Work Institute Europe.
Accenture awarded “Best Employer” for second straight year.

More on Vlerick Leuven Gent Management School @ http://www.vlerick.be/en/home.html

Microsoft releases ASP.NET MVC (Preview 3)

This Tuesday May 27th Microsoft released the Preview 3 build of the ASP.NET MVC framework. This build includes some additional features not in last month's drop, some nice enhancements/refinements, as well as Visual Studio tool integration and documentation.

You can download an integrated ASP.NET MVC Preview 3 setup package here. You can also optionally download the ASP.NET MVC Preview 3 framework source code and framework unit tests at http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=aspnet&ReleaseId=13792

Read more at Scott Guthries' blog here -http://weblogs.asp.net/scottgu/archive/2008/05/27/asp-net-mvc-preview-3-release.aspx

- Dipesh

Tuesday, May 27, 2008

StyleCop released as Microsoft Source Analysis

Source Analysis is similar in many ways to Microsoft Code Analysis (specifically FxCop), but there are some important distinctions. FxCop performs its analysis on compiled binaries, while Source Analysis analyzes the source code directly. For this reason, Code Analysis focuses more on the design of the code, while Source Analysis focuses on layout, readability and documentation. Most of that information is stripped away during the compilation process, and thus cannot be analyzed by FxCop.

Source Analysis comes with a set of default rules analyzers covering approximately 200 best practice rules. These rules are full compatible with the default layout settings in Visual Studio 2005 and Visual Studio 2008.

Read more -
http://blogs.msdn.com/sourceanalysis/archive/2008/05/23/announcing-the-release-of-microsoft-source-analysis.aspx

Friday, May 23, 2008

Accenture ranks first in global outsourcing, unseating IBM

Unseating two-time leader IBM, Accenture placed first on the Global Outsourcing 100, the annual list of the world’s top outsourcing service providers compiled by the International Association of Outsourcing Professionals (IOP). “We won on customer testimonials—the strongest evidence you can have,” says Kevin Campbell, group chief executive-Outsourcing.

Global 2008 Outsourcing ranikings -

RANK: 1
COMPANY: Accenture
KEY STRENGTH: Customer Testimonials

RANK: 2
COMPANY: IBM
KEY STRENGTH: Size & Growth

RANK: 3
COMPANY: Infosys Technologies
KEY STRENGTH: Executive Leadership

Here's the complete list - http://www.outsourcingprofessional.org/content/23/152/1197/

Thursday, May 22, 2008

Why am i not getting any SQL notifications fired?

Why am i not getting any SQL notifications fired?
What are the constraints implementing SQL Server 7/2000 Dependency Caching? (see below...)

Here are few quick things you can check real quick
- Check your query string. Is it valid?
- Be sure you don’t have select *
- Be sure you do have two-part names for the tables e.g., dbo.countries
- Ensure that you have your broker service enabled: Run SET ENABLE_BROKER

- Check the compatibility mode of your database to be set as 90 at the database level. You can see and modify this setting in the Database Properties/Options/Compatibility level. *

- If you are want to use compatiblity mode 80 then you can still achieve it by setting ARITHABORT ON for the database properties or specifying at each individual connection as an example below -

Example:
--------------------------
Dim conn As SqlConnection = New SqlConnection(connectionString)
conn.Open()

Dim cmd1 As New SqlCommand("SET ARITHABORT ON", conn)
cmd1.ExecuteNonQuery()

Dim cmd As New SqlCommand("SELECT country, country_desc FROM dbo.COUNTRY", conn)

dep = New SqlDependency(cmd)
AddHandler dep.OnChange, AddressOf TableProxy.OnDependencyChanged
Dim rdr As SqlDataReader
rdr = cmd.ExecuteReader()
dtLocal.Load(rdr)
---------------------------------

There are several constraints as well in the way which query you can use for SQL notifications ....

Don’t use queries whose results will change frequently.
Don’t use Select * in queries.
Do select explicit columns.

Don’t use UNION, DISTINCT, or TOP.
Don’t use Aggregate functions such as AVG, MAX, etc...

Take a detailed peek at the do's and dont's here -
http://msdn.microsoft.com/en-us/library/aewzkxxh.aspx

Take a look at ASP.NET’s Visual Web Developer Guided Tour for implementing SQL Server 7/2000 Dependency Caching at -
http://www.asp.net/Guided-Tour/s23.aspx

HTH, Thanks - Dipesh

Tool to generate .net query or fetchXML in CRM

Following stunware tool is pretty useful that lets you graphically build a query that generates either fetchXml or c# / vb.net query which you can copy and paste in your code in CRM 4.0

http://www.stunnware.com/crm2/topic.aspx?id=Framework1

Similar tool for CRM 3.0 can be found too at - http://www.stunnware.com/crm2/topic.aspx?id=FindingData6

Often you may have faced cryptic errors from CRM web service like "0x80041103: The specified attribute does not exist on this entity. Platform" that burns quite few hours. Most of the time this is because of incorrect query statements or mispelled words or something very trivial to catch your eyes. Hence this is of great help. Though i still prefer hand coding myself as that is a great learning! :)

Wednesday, May 21, 2008

Best Practices for implementing web services

Here's a codeproject article I went through for best practices for implementing web services (worth a read) - http://www.codeproject.com/KB/cpp/Web_Services.aspx

Thanks - Dipesh

Best Practices for Security in WCF...

Good article to read on Microsoft MSDN site-
http://msdn.microsoft.com/en-us/library/ms731059.aspx

How to implement SQL notifications in .net?

How do i notify the .net client when data changes in SQL server backend?
How to implement SQL notifications in .net easy way?

Query Notification, a collaboration between Microsoft’s ADO.NET and SQL Server teams. In a nutshell, Query Notification allows you to cache data and be notified when the data has been changed in SQL Server. Upon notification, you can then refresh your cache or take whatever action you need to.

Query Notification is possible because of a new feature in SQL Server 2005 called Service Broker. Service Broker puts queuing functionality into the database with a coordination of queues that communicate with services that, in turn, know how to communicate back to the calling entity. The queues and services are first class objects just as tables, views, and stored procedures are. Although Service Broker can be leveraged completely within SQL Server, ADO.NET knows how to communicate with Service Broker to trigger this mechanism and retrieve the notifications back from the Service Broker.

On the .NET side, there are a number of ways of hooking into this functionality. ADO.NET 2.0 provides the System.Data.SqlClient.SqlDependency and System.Data.Sql.SqlNotificationRequest classes. SqlDependency is a higher-level implementation of SqlNotificationRequest and is most likely the one you will use when working with ADO.NET 2.0. ASP.NET 2.0 also communicates with Service Broker through the System.Web.Caching.SqlCache-Dependency class (that provides a wrapper around SqlDependency), as well as directly through functionality provided declaratively in an ASP.NET page using the <%OutputCache> directive. This allows ASP.NET developers to easily invalidate caches that are dependent on data from SQL Server.

Read this article for implementation details - http://www.code-magazine.com/Article.aspx?quickid=0605061

Credits: I got the pleasure of working with Jeff Clark for a short stint though at Avanade recently and i learnt quite a few things from him...

how to raise and handle events/callbacks in .net?

How to implement and respond to Events in .net ?

In the following example, you'll create a class library containing a class that raises a pair of events. Then you'll create a user interface application that can respond to those events. You'll use both compile time event association with Handles and run-time event association with AddHandler.

Create the Class Library
Follow these steps to create the class library that will raise the events:

Open Microsoft® Visual Studio® .Net, and on the Start Page, click New Project.
On the tree view on the left-hand side of the screen, click Visual Basic Projects.
Click Class Library to select it as the project template.
Set the name of the application to Water and click OK to create the project.
Click the class called Class1.vb in the Solution Explorer window and rename it to Bucket.vb.
Select the code for Class1 in Bucket.vb (this will be an empty class definition) and replace it with the following code:

Class Bucket

Private ContentsValue As Integer
Private CapacityValue As Integer
Private NameValue As String

Public Event Full()
Public Event Overflowing(_
ByVal sender As System.Object)

Public Sub New(ByVal Capacity As Integer)
mintCapacity = Capacity
mintContents = 0
End Sub

Public Sub Empty()
mintContents = 0
End Sub

Public ReadOnly Property Contents()
Get
Contents = mintContents
End Get
End Property

Public Property Name() As String
Get
Name = mstrName
End Get
Set(ByVal Value As String)
mstrName = Value
End Set
End Property

Public Sub Add(ByVal Amount As Integer)
mintContents = mintContents + Amount
If mintContents > mintCapacity Then
RaiseEvent Overflowing(Me)
mintContents = mintCapacity
ElseIf mintContents = mintCapacity Then
RaiseEvent Full()
End If
End Sub

End Class

This code creates a class named Bucket to represent a bucket that can be filled with water. The New method initializes the bucket with a specified capacity. The Name property assigns a name to the bucket. The Add method adds water to the bucket, and the Empty method empties the bucket.

The Bucket class includes two event declarations:

Public Event Full()
Public Event Overflowing(_
ByVal sender As System.Object)

These two events are both raised within the Add method. If the amount of water in the bucket exceeds the capacity of the bucket, the code raises the Overflowing event. Otherwise, if the amount of water in the bucket exactly equals the capacity of the bucket, the code raises the Full event.

Note that the argument lists of the two events are different. You have complete flexibility to pass whatever information you need in any particular event.

On the Build menu, click Build or press Ctrl+Shift+B to build the class library.
Create the User Interface Project
Follow these steps to create a Windows Application to test the events of the Bucket class:

Open Visual Studio .Net and on the Start Page, click New Project.
On the tree view on the left-hand side of the screen, click Visual Basic Projects.
Click Windows Application to set it as the project template.
Set the name of the application to BucketTest and click OK to create the project.
Select the form called Form1.vb in the Solution Explorer window and rename it to frmBuckets.vb.
Create the form by adding the appropriate controls and setting the properties of those controls.

Add Code to Handle Events
Now you're ready to write code to handle the events from the Bucket class. This code will create three objects of the Bucket class. The Full events will be individually connected to event handlers at compile time using Handles. The Overflow events will all be handled by a single procedure, dynamically associated with the events at run time by using AddHandler.

On the View menu, click Code, and enter this code before the Windows Form Designer generated code:

Dim WithEvents Bucket1 As New Water.Bucket(10)
Dim WithEvents Bucket2 As New Water.Bucket(10)
Dim WithEvents Bucket3 As New Water.Bucket(10)

Now enter this code after the Windows Form Designer generated code:

Private Sub Form1_Load(_
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Bucket1.Name = "Bucket 1"
Bucket2.Name = "Bucket 2"
Bucket3.Name = "Bucket 3"
AddHandler Bucket1.Overflowing, _
AddressOf HandleOverflow
AddHandler Bucket2.Overflowing, _
AddressOf HandleOverflow
AddHandler Bucket3.Overflowing, _
AddressOf HandleOverflow
End Sub

Private Sub btnAdd1_Click(_
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd1.Click
Bucket1.Add(1)
pb1.Value = Bucket1.Contents
End Sub

Private Sub btnAdd2_Click(_
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd2.Click
Bucket2.Add(1)
pb2.Value = Bucket2.Contents
End Sub

Private Sub btnAdd3_Click(_
ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnAdd3.Click
Bucket3.Add(1)
pb3.Value = Bucket3.Contents
End Sub

Private Sub Bucket1_Full() Handles Bucket1.Full
lblFull1.Visible = True
End Sub

Private Sub Bucket2_Full() Handles Bucket2.Full
lblFull2.Visible = True
End Sub

Private Sub Bucket3_Full() Handles Bucket3.Full
lblFull3.Visible = True
End Sub

Private Sub HandleOverflow(_
ByVal sender As System.Object)
lboOverflow.Items.Add(sender.Name & " Overflow!")
End Sub

Read more on this msdn site where you will find this example and details - :
http://msdn.microsoft.com/en-us/library/ms973905.aspx

Tuesday, May 20, 2008

Designing and working with Spatial data type in SQL 2008

One of the interesting feature of SQL 2008 that had my eye balls rolling was the introduction of Spatial data type/Column.

SQL Server 2008 and later versions support spatial data. This includes support for a planar spatial data type, geometry, which supports geometric data—points, lines, and polygons—within a Euclidean coordinate system. The geography data type represents geographic objects on an area on the Earth's surface, such as a spread of land. A spatial index on a geography column maps the geographic data to a two-dimensional, non-Euclidean space.

A spatial index is defined on a table column that contains spatial data (a spatial column). Each spatial index refers to a finite space. For example, an index for a geometry column refers to a user-specified rectangular area on a plane.

Here's more to it on msdn - http://msdn.microsoft.com/en-us/library/bb964712(SQL.100).aspx

Here's all that you wanted to know on designing and working with Spatial data type in SQL 2008 - http://msdn.microsoft.com/en-us/library/bb933790(SQL.100).aspx

How to connect to other SQL Server from SQL Server 2005 (using linked list)?

Whenever you want to connect the other SQL Server from SQL Server 2005(using linked list), use the NATIVE CLIENT.

Read more about native client - http://msdn2.microsoft.com/en-us/library/ms131456.aspx

Wednesday, May 14, 2008

Accenture and Avanade announced the availability of its first retail showcase application for Microsoft Surface....

Accenture (NYSE: ACN) and Avanade Inc. announced the availability of its first retail showcase application for Microsoft SurfaceTM. This new application has the potential to transform the shopping experience by using Microsoft Surface to improve customer loyalty, allow customers to better understand complex purchases, build customer relationships and increase add-on sales. Read more here ... http://newsroom.accenture.com/article_display.cfm?article_id=4651

Regards - Dipesh

Third major release of Windows Presentation Foundation (WPF)

Microsoft introducing the third major release of Windows Presentation Foundation (WPF)

http://blogs.msdn.com/tims/archive/2008/05/12/introducing-the-third-major-release-of-windows-presentation-foundation.aspx

Regards - Dipesh

Thursday, May 01, 2008

WSE and WCF

Applications built using WSE 1.0 and WSE 2.0 won't interoperate with applications built on WCF and some effort is required to move existing WSE code to new Windows Communication Foundation framework.
Applications built on WSE 3.0, will interoperate with WCF applications, however!