Friday, August 27, 2010

Links to download MVVM Project Templates for WPF

Following are links for some of the project templates for the MVVM

1. WPF Model-View-ViewModel Toolkit [By Microsoft]

http://wpf.codeplex.com/wikipage?title=WPF%20Model-View-ViewModel%20Toolkit

2. MVVM Light Toolkit [By gala soft]

http://www.galasoft.ch/mvvm/getstarted/

MVVM Light in Codeplex

http://mvvmlight.codeplex.com/

3. MVVM Foundation [by Jogn Smith]
http://mvvmfoundation.codeplex.com/

Silverlight 4 Tools And Themes download Links

Microsoft Silverlight 4 Tools for Visual Studio 2010

http://www.microsoft.com/downloads/details.aspx?FamilyID=40ef0f31-cb95-426d-9ce0-00dcfabf3df5&displaylang=en

Silverlight 4 Application Themes

http://www.microsoft.com/downloads/details.aspx?FamilyID=e9da0eb8-f31b-4490-85b8-92c2f807df9e&displaylang=en

NOTE : Get the latest silverlight runtime from the following link

http://go.microsoft.com/fwlink/?LinkId=146060

Wednesday, August 18, 2010

How to use Sql Server Stored Procedure in .Net Entity Framework

Following URLs will help

Using Stored Procedure in ADO.NET Entity Framework 4.0

http://channel9.msdn.com/posts/wriju/Using-Stored-Procedure-in-ADONET-Entity-Framework-40/

--
How to Retrieve Stored Procedure Output Parameters in Entity Framework

http://dotnet.dzone.com/news/how-retrieve-stored-procedure?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+zones%2Fdotnet+%28.NET+Zone%29

or

How to Retrieve Stored Procedure Output Parameters in Entity Framework

http://blogs.microsoft.co.il/blogs/gilf/archive/2010/05/09/how-to-retrieve-stored-procedure-output-parameters-in-entity-framework.aspx

Alternate to Dynamic Sql in Sql Server

Following in the Example having an alternate to Dynamic Sql in Sql Server
----------------------------------
create table testtable

( col1 int, col2 int)

insert into testtable(col1, col2)
Values
(10,20),
(30,40),
(11, 15),
(17, 16)
----------------------
Show 1
-----------------------
Declare @col1 int
Declare @col2 int

Set @col1 = 15
SET @col2 = null

Select * from testtable
Where (col1 > @col1 OR @col1 IS NULL)
AND (col2 > @col2 OR @col2 IS NULL)

--------------------------------
Show 2
--------------
Declare @col11 int
Declare @col12 int

SET @col11 = 10
set @col12 = 30
Select * from testtable
Where (col1 = @col11 OR @col11 IS NULL)
or (col1 = @col12 OR @col12 IS NULL)
---------------------------------
Drop table testtable
------------------------

Also you can check the following article from the code project by John P Harris, which have different ways of avoiding Dynamic Sql such as

* Using COALESCE
* Using ISNULL
* Using CASE
* Alternative

Implementing Dynamic WHERE-Clause in Static SQL

Tuesday, August 10, 2010

Installing Sql Server 2008 Express Management Studio in Windows 7

Ooops!!! This was tough part for me. After lot of surfing on this topic, i found a way to do this.
1. Uninstall the Sql Server Express 2005.
First uninstall the Sql Server 2005 from the Control Panel options
Then remove the "HKLM\Software\Wow6432Node\Microsoft\Microsoft SQL Server\90" key from the registry.
Reference :
Can't Uninstall SQL Server 2005 Express Tools
sql-server-2008-rc0-install-sql2005ssmsexpressfacet

2. Install the Sql Server 2008 Express Management Studio as given in this Article

Following are some articles those may help you to resolve this:
Can't Install Microsoft SQL Server 2008 Management Studio Express

-- In this article, it is suggested that
i. Install Sql Server Management Studio first and then Install Sql Server Express 2008
ii. Else use the "Sql Server Express with Tools" to Install.

Cheers...

Friday, August 6, 2010

Select and Copy only Visible Cells, Columns or Rows in MS Excel 2007 and 2003?

To get the menu for only selcting visible rows, Please follow below link

Select and Copy only Visible Cells, Columns or Rows in MS Excel 2007 and 2003?

The Steps are given as below

So how to select only visible cells, or in other words how to not select hidden cells, rows or columns while copying?

In MS Excel 2007, to add the Select Visible Cells Command, do the following steps:
Step 1: Right click on the toolbar on top and click Customize Quick Access toolbar.
Step 2: Under Choose Command From drop down menu, select Commands Not in the Ribbon.
Step 3: Scroll down and click on Select Visible Cells.
Step 4: Click on Add and OK.

How to Delete Empty Rows those are in between in MS Office Excel?

I had a problem on deleting the empty rows from a excel. I found the below article that was helpful.
How to Delete Empty Rows those are in between in MS Office Excel?

The Steps are as below.

Note: Make sure you already don’t have any cells or rows hidden. If you have hidden items, you may lose that data.

Step 1: Select the column from which you want to choose those empty or blank cells. (Let’s say Column A)
Step 2: Press F5 (Function Key). Click on Special and Select Blanks and Click OK.

Step 3: The Blank Cells will be highlighted now.

Step 4: Use the keyboard shortcut key (Ctrl + 9) to hide the rows which has highlighted cells. (Click here for keyboard shortcuts for hiding and unhiding rows and columns in Excel.)

Step 5: Use Select Visible Commands, to select only rows that are visible and Press Ctrl + C to copy the entire worksheet. This doesn’t copy the hidden rows. (Select Visible Command is a hidden option in Excel, if you don’t know how to use it or where it is, read ‘How to select only visible cells in Excel?’)

Note :Follow this To Select only rows that are visible.

Step 6: Paste (Ctrl + V) it in a new sheet. Now you have a new sheet which doesn’t have any empty rows. You can delete the old sheet if you want!

Wednesday, August 4, 2010

ObservableCollection Class in .Net (WPF)

WPF provides the ObservableCollection class, which is a built-in implementation of a data collection that implements the INotifyCollectionChanged interface.

We can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the INotifyCollectionChanged interface. This interface exposes the CollectionChanged event, an event that should be raised whenever the underlying collection changes.

So, by using ObservableCollection, we no need to Implement the INotifyCollectionChanged interface.

References

ObservableCollection Class

List vs ObservableCollection vs INotifyPropertyChanged in Silverlight

Silverlight Databinding – The Observable Collection

What is INotifyPropertyChanged Interface

The INotifyPropertyChanged interface is used to notify clients, typically binding clients, that a property value has changed.

To Understand more on INotifyPropertyChanged Inteface, follow these links

INotifyPropertyChanged Interface

AutomagicallyImplementingINotifyPropertyChanged

View Models: POCOs versus DependencyObjects

Bind Better with INotifyPropertyChanged

INotifyPropertyChanged Is Obsolete

Difference Between .Net 4 Framework And .Net 4 Framework Client Profile

NET4 Client Profile is smaller and faster to install compared to the NET4 Full Framework (NET4 is 7-8MB smaller in size than the Full Framework), the main reasons are not just better deployment size/time but also:

•Reduce the Framework deployment failures.
•By keeping ASP.Net and other components (that are mostly needed for servers) out of the Client Profile, we can reduce the attack surface and the number of future servicing events which may be caused by server component (such as ASP.Net) and are not needed for desktop scenarios.
•Making NET4 Client Profile available on Windows Update will make sure that most desktop machines will include NET4 Client Profile over time and apps that target the Client Profile will not need to carry or install the Framework which will improve the overall deployment experience.
•Enable us to add features and grow the size of overall Framework in future versions but still have a smaller core.

Reference:

http://blogs.msdn.com/b/jgoldb/archive/2010/04/12/what-s-new-in-net-framework-4-client-profile-rtm.aspx

Stop Folder Sharing in Windows 7

Kindly follow below steps to stop sharing a folder in Windows 7

1.Open Computer Management. To do so, click Start, then right-click Computer, and then click Manage.

2.If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.

3.In the console tree, click System Tools, then click Shared Folders, and then click Shares.

4.In the details pane, right-click a shared folder, and then click Stop Sharing (this item only appears if you launched Computer Management using an account that is a member of the local Administrators group).

To stop sharing multiple files, press the CTRL key while clicking the file names, right-click any one of the selected files, and then click Stop Sharing. This removes shared network access to the selected files.

Reference

http://technet.microsoft.com/en-us/library/cc753475.aspx