Saturday, November 14, 2009

Using Reflection to Get and Set values of Properties

The assembly that is generated for .Net Framework has metadata that describes the structure of the assembly and its classes. By using reflection we can investigate the structure of classes and the data that assembly holds dynamically at runtime.

You can dynamically get/set values from/to properties of object. #

Get value

foreach (PropertyInfo info in myObject.GetType().GetProperties())
if (info.CanRead)
object o = info.GetValue(myObject, null);

Set value

object myValue = "Any_Value";
if (info.CanWrite), myValue, null);

It's very helpful and easy to use. Isn't is ?

Wednesday, November 11, 2009

SyncToy 2.1 Available for Download

How many times have you tried to copy a huge number of files only to accidently hit space or escape cancelling the transfer and you don't want to re-start from scratch? Well there's a better way to sync files between directories and drives, SyncToy. You might remember this from the XP PowerToys days, the ease of use makes it a very popular download.

SyncToy 2.1 has just been released to the Microsoft Download center. SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders.

SyncToy2.1 is powered by the latest synchronization engine from Microsoft Sync Framework 2.0 and provides better performance and robustness. The new features and improvements included in SyncToy 2.1 release are:
Better Performance: The speed of file copy operations is significantly increased across the board.
Improved Robustness: Much more resilient to transient network and file system errors, and better error reporting that pinpoints which file the sync failed on in case there’s a fatal error that stops the sync.

Folder pair configuration backup: Folder pair configuration is automatically backed up under %localappdata%\microsoft\synctoy\2.0. You can replace SyncTopDirPairs.bin with the backup copy to resolve the last saved configuration.

Bug Fixes:
o Fixed the data corruption issue when using SyncToy with NAS drives.
o Fixed the bug that prevented uploading files to SharePoint when using SyncToy 2.0.
o Fixed bugs that prevented delete changes from being synchronized when sync option was set to

SyncToy 2.1 is now available for download from:

Wednesday, November 4, 2009

Use Temp Table in SQL SERVER 2005 Reporting Services

I was working on 2005 SSRS to generate a reprot which required a use of Temporary Tables in the dataset. But unfortunately SSRS 2005 doesn't support it. 2008 supports both Table Datatype and Temp Tables.

To resolve the issue we can use Table DataType. Below is the example:


INSERT INTO @TempTable VALUES(1, GETDATE(), 'Ranjit');
INSERT INTO @TempTable VALUES(2, GETDATE(), 'Ranjitsingh');

SELECT * FROM @TempTable
This way you can resolve the Temp table issues by using Table Datatype.

PostBack in ASP.Net showModalDialog opens a new window

When working with Modal Dialog Windows in ASP.Net you have experience that postback opens up a new window. This behavior is by default.

I was using window.showModalDialog() to open a ASPX Page from the parent page using JavaScript. But whenever the postback happens in the modal window during a button click or dropdown value changes, it would spawn off a new window.

You can change the behaviour by just including below tag line in the <head> of the modal window (that is aspx page).
<base target="_self">

I hope this would help you resolving the problem.

Missing ASP.NET and ASP.NET Web Service Project Templates

Missing ASP.NET and ASP.NET Web Service Project Templates?

You are at the right place to solve your problem. Just visit the below link and dlwonload the .msi file.

After instalation ASP.NET web aplication template and WebService appears in New Project Promt .

Isn't it simple solution?