Wriju's BLOG

.NET, Cloud and everything

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 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

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

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