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.
It is a statement that every LINQ statement returns IEnumerable<T>. IEnumerable works in steps. Meaning, when you write,
var q = from a in b
where a > 5
It creates a list out “b” depending on “where” then it creates another list for “select”. This is the behavior of LINQ to Object and LINQ to XML.
When you use LINQ to SQL it uses IQueryable<T>. This interface inherits from IEnumerable<T> but typically any LINQ to SQL generates T-SQL at the backend to be able to get the data for us. This evaluate and generates the query at one shot and gives us the whole data.
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"?>
<product ProductID="1" CategoryID="1">
<product ProductID="2" CategoryID="1">
Now this code holds namespace and all the child element’s default namespace would be that one “myns-com”.
So if you try to write query against this XML
var query = from lst in XElement.Load(@"c:\NS.xml").Elements(“product")
foreach (var k in query)
This seems correct though it will not give you any output.
What you need to do is, you need to the namespace in the query,
XNamespace ns = "myns-com";
var query = from lst in XElement.Load(@"c:\NS.xml").Elements(ns+"product")
You will get the desired output as you may expect.
We do not have to follow the CSS 2.1 standard to be able to run it in IE 8. If your site runs on IE 7 without any issue the same will run on IE 8 with some simple effort. This has been described well in the KB Article # 952030.
In IIS you can add the following header info,
In the web.config under configuration section you can add add,
<add name="X-UA-Compatible" value="IE=EmulateIE7" />
You can modify a single page by adding meta tag,
<html xmlns="http://www.w3.org/1999/xhtml" >
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<form id="form1" runat="server">
Find more on Microsoft's Interoperability Principles and IE8.
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
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
Ø Developer productivity
Ø User productivity
This version of IE allows us (anyone regardless he is pro/dev) to be able to customize. There were bugs in IE7 that are addressed here apart from the new features.
The WebSlice and Activity are the most amazing things here. If you install it you will enjoy them.
Some start up resources,
Find more on,