Wriju's BLOG

.NET, Cloud and everything

Application Architecture Guide 2.0 Released – Free E-Book Download

Happy news for all the developers around the world, we have released the Patterns and Practices guidance on Application Architecture. It is 381 paged PDF book and freely available from http://www.codeplex.com/AppArchGuide. This books is majorly divided into four parts, Part I, Fundamentals Part II, DesignPart III, LayersPart IV, Archetypes and forwarded by S. Somasegar and… Read more

Windows Live Photo Gallery : Easily Stitch Panoramic Photos

I am visually challenged nor a good photographer. Recently I have been to the foot hills of Eastern Himalayan range (http://en.wikipedia.org/wiki/Buxa_Tiger_Reserve). I and Tupur been to the dry river bed of Jayanti, took some series of photos. I had plan to stitch them. Wonder!!! Live Photo Gallery already has this feature. Bingo!!! I created one…. Read more

CodeRush Xpress an amazing tool to work with Visual Studio 2008

Today I have came across a tool called CodeRush Xpress, a free AddIn which can be integrated with Visual Studio and make fun of the coding. This is a combined effort which DevExpress have had with Microsoft by leveraging the existing Visual Studio 2008 IDE. One scenario is very common to all of us when… Read more

PDC 2008 Must be Enjoyed

If you are thinking that you are a looser not by attending PDC 2008, forget it. Stretch your body as you might to stay connected to your chair for long time. What is Visual Studio 2010 Windows Azure Project "Velocity" Dublin Oslo Parallelism S+S and many more.. So without wasting time join and view the… Read more

ADO.NET Entity: LINQ to Entity with Relationship

Relationship and getting data from Entity Framework using Northwind database Simple Query   using (NorthwindEntities ctx = new NorthwindEntities()) {     var query = from o in ctx.Orders                 select o.OrderID;       foreach (var k in query)     {         Console.WriteLine(k);     } }   Now if you want to filter this with the… Read more

ADO.NET Entity: Insert Update and Delete with Relationship

Few days back I had written an article on Insert/Update/Delete for simple standalone tables at ADO.NET Entity: Insert Update and Delete. Now after that many of you had requested me to put article on how it works with relationship.   Here I will use a database created by me. There will be two tables connected… Read more

Visual Studio 2010 and .NET Framework 4.0 Overview

Know more about it and keep you sink with http://msdn.microsoft.com/en-us/vstudio/products/cc948977.aspx What’s New Overview of WF 4.0, WCF 4.0, and Windows Server “Dublin” Additional Resources Analyst Webcast: Trends and Innovations in the Application Server market Gartner: Magic Quadrant for Enterprise Application Servers Forrester: “Microsoft Is a Leader in Application Server Platforms” IDC Mission Critical Application Platform… Read more

ADO.NET Entity: Insert Update and Delete

For small blogs, it requires more references and explanation, which sometimes are redundant. So I thought of writing single blog which is combination of topics more or less related to one thing.   I am exploring ADO.NET Entity Framework and have been trying things out there. Here I am planning to demonstrate how to do… Read more

Microsoft Project Code Named “Velocity”

“Velocity” is a distributed in-memory application cache platform for developing scalable, high-performance applications. “Velocity” can be used to cache any CLR object and provides access through simple APIs. The primary goals for “Velocity” are performance, scalability and availability. http://msdn.microsoft.com/en-us/data/cc655792.aspx Technical Articles Blog Microsoft Project Code Named “Velocity” Team Blog Forum Microsoft Project Code Named “Velocity”… Read more

Windows Forms – Enable Shortcut Key all over the Form

Windows Application and shortcut key are synonyms. People prefer to use shortcut keys for faster activity. Assume you are in a text box and you want to hit F5 to reload the form. You do not want to move your mouse cursor. So what you will be doing is that you will be adding “Key… Read more

Programmatically invoking the Live.com search

Live.com you need to automate that in your Windows application. You will use the WebBrowser control. This is a very powerful control and allows us to control things through DOM. Here is a small code which insert values to the live.com’s seach text box and clicks the “Go” button. I have created a windows forms… Read more

LINQ to SQL vs. ADO.NET – A Comparison

ADO.NET is our contemporary data access component and now we have written many applications. Now there has been a lot of talk on LINQ to SQL. So we are little skeptical about this component and trying to find some relation between existing ADO.NET technology.   Purpose of this post is to give some quick brief… Read more

Celebrating 200th MSDN Blog Post

Wow experience!!! 200+ posts on MSDN with millions of hits it’s a great pleasure being at Microsoft with additional takeaways. I never thought in my life that I would be blogging. I had a dream that one day I will become writer (was not sure on what though). Blogging is a great tool to give… Read more

How to copy my snippet in Visual Studio 2008

I use Visual Studio 2008 code snippet a lot when I write code for my presentation. It saves a lot of time and it is very elegant. But I used to struggle a lot while changing my demo machine. Because I had to repeat the same process again and again from Tools > Snippet Manager,… Read more

ZoomIt : Fantastic Windows Zooming Application

When I show demo using my desktop I often come across to the scenarios where things are very small. I was using Windows Magnifier. I found this tool later and this is very helpful. This tool was created by Microsoft Technical Fellow, Mark Russinovich. Some facts, Ø  ZoomIt runs on System Tray Ø  Allows you… Read more

Visual Studio 2008 : How to zoom Class Diagram

During my demos I have noticed that Class Diagram in Visual Studio gives a very detailed view with lot of information. Now this is hard for people sitting at the back of the room to see what is there. It’s very easy, if you press “CTRL” then scroll the mouse, this will zoom in and… Read more

LINQ to SQL : Missing Manual are at MSDN

ADO.NET and LINQ to SQL Describes the relationship of ADO.NET and LINQ to SQL.   Analyzing LINQ to SQL Source Code Describes how to analyze LINQ to SQL mapping by generating and viewing source code from the Northwind sample database.   Customizing Insert, Update, and Delete Operations (LINQ to SQL) Describes how to add validation… Read more

What do I have to do if I install IIS after Visual Studio

What happens if you install you Visual Studio then realize that you need IIS for you application to test and run. We often do this. I have seen people uninstalling Visual Studio and then installing it again after IIS to make sure ASP.NET works fine. Wow!! There is an easy way to do it, Open… Read more

How to find public key token for a .NET DLL or assembly

Many times we need to get the Public key token for a strongly named assembly in .NET. FAQ on that “how to get the public key token?”. Answer is very simple use the .NET Framework tools sn.exe. So open the Visual Studio 2008 Command Prompt and then point to the dll’s folder you want to… Read more

LINQ to Entity : Querying data using ADO.NET Entity Framework

ADO.NET Entity Framework have evolved since we have released it first time. Now with the Visual Studio 2008 if you install the .NET Framework 3.5 SP1 and Visual Studio 2008 SP1 you will get the fully functional version of ADO.NET Entity Framework. This is post Beta 3 release. To create a .edmx file you have… Read more

LINQ to SQL: Making it N-Tier

You can create your application use LINQ to SQL and make it N-Tier. Go ahead and watch out the MSDN Documents N-Tier and Remote Applications with LINQ to SQL LINQ to SQL N-Tier with ASP.NET LINQ to SQL N-Tier with Web Services LINQ to SQL with Tightly-Coupled Client-Server Applications Implementing Business Logic (LINQ to SQL)… Read more

Aspiring Architect Webcast Series 2008

Dear Architects,   Please block you calendar….   June 16th, 2008 – 12:00 p.m. to 1:00 p.m. – Introduction to the aspiring architect Web Cast series http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380836&Culture=en-CA   June 17th, 2008 – 12:00 p.m. to 1:00 p.m. – Services Oriented Architecture and Enterprise Service Bus – Beyond the hype http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380838&Culture=en-CA   June 18th, 2008 –… Read more

Architecture Journal April 2008 : An A-Z Guide to Being an Architect

While coming to office today I was reading the last article An A-Z Guide to Being an Architect of April 2008 issue. This one is probably the most realistic thought I have ever read about being true architect. Some of the cool thoughts, Knowledge of technology is only one, albeit important, domain that an architect needs… Read more

LINQ to XML : Querying XML with Namespaces

This question arises in one of discussions. If you have a XML document with “xmlns” then LINQ to XML does not return any IEnumerable<T> J. This is strange but true for XPath and XQuery. There is a trick to get it done, Let us assume that you have a XML as follows, <?xml version=“1.0“ encoding=“utf-8“?>… Read more

Internet Explorer 8 : Will the existing sites break?

With IE 8 and strong CSS 2.1 compliance, the sites which used to run perfectly fine with IE 7 might break. The error typically could be like, formatting, alignment or JavaScript issues. This is beta and there are ways to prevent all such problems easily. We do not have to follow the CSS 2.1 standard… Read more

Internet Explorer 8: Start of a new era

Being web developer I am super excited about the release of Internet Explorer 8. There are lots of talks and already we have Beta 1. Now there are some thousands features with this version and many are planned for the new version. Excitements anxiousness and many more.. The two major goals for this release are… Read more

Visual Studio 2008 Product Comparison

One of the mostly asked questions in the Visual Studio adopters group is “what am I not getting with my version?”. This probably sometimes leads to a business decision towards buying. Download the data sheet (from MSDN) One place for all your queries, at http://msdn.microsoft.com/en-us/vstudio/products/cc149003.aspx Namoskar!!!… Read more

LINQ : IEnumerable<T> and IQueryable<T>

IEnumerable<T> and IQueryable<T> are the two most used terms of any LINQ discussion. What I am trying to here is that I am trying to simplify the two interfaces depending on their behavior. In LINQ world we generally have few providers available within .NET Framework, like LINQ to Object, LINQ to SQL, LINQ to XML…. Read more

LINQ to SQL : FAQ Answer By Matt Warren

Wonderful composition of FAQ is available at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2769747&SiteID=1 by Matt Warren.   Q: How do I get default values from the database when inserting new entities? A: LINQ to SQL does not support using default values from the database.  The values in the entity at the time SubmitChanges is called are used instead.  You can… Read more

MSDN Magazine Topics Online

Windows Server (313) Windows Client (90) .NET (938) ADO / ADO.NET (89) ASP / ASP.NET (266) BizTalk (11) C# (566) C++ (274) COM / COM+ (79) Concurrency (76) Data Access (147) DataGrid / GridView (30) Delegates (18) Design Patterns (28) DirectX (9) Exchange (3) Globalization (23) Graphics (62) IIS (36) Java (7) JavaScript (84) Microsoft… Read more

LINQ to XML : Modifying XML document

You have XML document now you want to modify that XML file using LINQ to XML. It is as easy as you generally modify any database column value.   Let us create a dummy XML stream,   //Create dummy XML to work var root = new XElement(“parent”,     from i in new int[] { 1,… Read more

LINQ to XML : Changing connectionString in app.config

When you create data bind application using wizard in Windows Forms application and connection string gets added to you settings file. Now you may be interested in changing that connection string but problems, 1)     The connection string in settings has an Application Scope so it is ReadOnly property. You modify and remove “ReadOnly” from .vb… Read more

The Developer Highway Code Free E Book

The Developer Highway Code, written by Paul Maher of DPE, is a concise handbook that captures and summarizes the key security engineering activities that should be an integral part of the software development process. This companion guide should be a must for any Developer, Architect, Tester etc. undertaking software development…The book is presented in easy… Read more

LINQ to XML : Adding Namespace quickly

I have written a post earlier on how to attach Namespaces. After reading my article someone complained about the redundancy of the code. I also realized the pain. I was reading the book C# 3.0 In a Nutshell. There I got a very elegant solution. Let me explain the scenario,   If you create a… Read more

LINQ to XML : Join Xml Data

Let’s say I have created two Xml files using LINQ to XML from Northwind database. I have taken two tables Category and Products and tried to join between two different files.   Category XML   <?xml version=“1.0“ encoding=“utf-8“?> <categories>   <category id=“1“>     <CategoryName>Beverages</CategoryName>   </category>   <category id=“2“>     <CategoryName>Condiments</CategoryName>   </category>   <category… Read more

LINQ to XML : Working with Prefixes

Based on my previous post on LINQ to XML : Working with Namespaces, if you want to add prefixes to your Xml things becomes little crazy. The trick is that you have to use XAttribute() to attach prefixes. So the Xml as below need the following code,     <pfx:root xmlns:pfx=“urn:mynamespace-com“>   <pfx:child /> </pfx:root>… Read more

LINQ to XML : Working with Namespaces

If you are working with complex real world XML then you have to deal with namespaces to disambiguate. There are several ways to implement namespaces in LINQ to XML. One is you can use pure string to add your namespace with each element declaration, like   <root>   <child /> </root>   To create the… Read more

LINQ to SQL Overview Video

Luca, the Microsoft Lead Program Manager, he is one of my favorite presenters. The way he demonstrate uninteresting thing and make fun of himself is one everyone should learn. Please enjoy the through presentation of LINQ to SQL at http://blogs.msdn.com/lucabol/archive/2008/03/03/linq-to-sql-overview-video.aspx   Namoskar!!!… Read more

C# 3.0 Query Expressions by Bruce Eckel and Jamie King

Bruce, a renowned author of the famous book “Thinking in Java” is now exploring C# 3.0. He wrote many other books on Ø       The Hands-On Java Seminar CD ROM (available on the Web site) Ø       Thinking in C++ (PH 1995; 2nd edition 2000, Volume 2 with Chuck Allison, 2003) Ø       C++ Inside & Out (Osborne/McGraw-Hill… Read more

LINQ to XML : Creating complete XML document

LINQ to XML API allows us to create complete XML document as expected with all the elements. So this X-DOM has everything as you expect.   Simple sample looks like,     XDocument doc = new XDocument(     new XDeclaration(“1.0”, “utf-16”, “true”),     new XProcessingInstruction(“test”, “value”),     new XComment(“This is comment by you”),     new… Read more

LINQ to XML : Creating XML from another XML

Based on my previous post if I have to filter the list of customers only in the country “US” and create another XML which may look like,   <?xml version=“1.0“ encoding=“utf-8“?> <usaCustomers>   <usaCustomer>     <title>Marketing Manager</title>     <name>Howard Snyder</name>   </usaCustomer>   <usaCustomer>     <title>Sales Representative</title>     <name>Yoshi Latimer</name>   </usaCustomer>   <usaCustomer>    … Read more

LINQ to XML : Creating complex XML through LINQ

We can generate hierarchical object graph in our memory though LINQ. To be more realistic we can bring data from relational database. So if we consider Northwind database and use LINQ to SQL to bring all the Customers and their Orders and Order Details the query would look like,     //LINQ to SQL way… Read more

LINQ to XML : Two important classes XElement and XAttribute

XElement and XAttribute are the two  very important classes available in System.Xml.Linq.dll assembly. Using these two classes you can do lot of things in the LINQ to XML world. I will show you step by step how,   For just an element   XElement _root = new XElement(“root”);   _root.Save(fileName);   And the output will… Read more

VB.NET 9.0: XML Literal

This is the one feature which can make VB.NET developers feel better than C# folks. I have seen people complaining about MS saying that MS has done lot for C# but not equally for VB.NET. One of the biggest was Refractoring. There are so many such. But this feature is just “SPELLBOUND” when I first… Read more

VB.NET 9.0: Lambda Expression Function

If you want to use Lambda Expression as reusable function, you need to use Func. By using the Func we are actually calling in-build delegate.   So if you write   Dim sqr As Func(Of Double, Double) = Function(x) x * x   Then you can use it in you application to get the square… Read more

VB.NET 9.0: Lambda Expression

In VB.NET 9.0 Lambda is one of the features we have here. Lambda expression is just another way to call Anonymous method/delegate.   Let’s look into a generic list of integers, and play with it,   Dim arrInt As New List(Of Integer)   For i As Integer = 1 To 10     arrInt.Add(i) Next  … Read more

VB.NET 9.0: Object and Array Initializers

Last week I was exploring VB.NET for the ISV demo delivery. Some findings I want to share with you. First the object and Array Initializers   Let’s suppose we have a class called Customer   Public Class Customer     Public Id As Integer     Public Name As String End Class   Now when you initialize… Read more

ADO.NET : OleDbCommand Parameterized Query Sequence Rule

While working with MS Access database with OleDbCommand you might have faced issue that your parameterized update statement is not working. The most frustrating part is that it also does not throw any runtime error. So ideally you paralyzedJ.   Golden rule is that you need to maintain the exact sequence of parameters you have… Read more

LINQ to SQL : Understanding Mapping

In LINQ to SQL you play with pure .NET objects and write your LINQ on top of that. But question might arise how this magic happens. Though we say that it is object, the question might arise in our mind that there has to be a mechanism through which it connects. Yes, there is. That… Read more