Max's Blog

.NET, Windows Phone, SQL Server and other exciting stuff

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 19 Comments | 0 Trackbacks


Tag Cloud



December 2009 Entries

Now that we have some basics for LINQ for XML. Lets get deep into some using LINQ against Relational databases, aggregate functions, like group by and sort. The database we will be using is books, this can be obtained from this page. Once you download the database, mount it in SQL Server by attaching this mdf file. Once the mdf file is mounted, we can start with the following steps to do our first LINQ to SQL console program. 1) First of all we need to add a new DB by selecting Tools > Connect ......

Now that we’ve got some basics of LINQ for XML. I think we should also look into group by queries in LINQ for XML. My motivation here would be to find the total price of books for each of the genre. For this, I should write LINQ something similar to this below: var query3 = from p2 in query_1 group p2 by p2.Element("genre").Value into b1 select new { Value = b1.Key, Price = b1 }; We group by particular node value using group p2 by p2.Element("genre").Value into b1, here b1.Key will give you the distinct ......

It looked like we should look a bit about LINQ fundamentals before we actually get into the core programming for our Silverlight twitter application. So we’ll look into LINQ for a few more posts, then we will proceed with our usual Silverlight stuff. Line INtegrated Query allows us to use Query language to select data from almost any type of data sources like XML, SQL, Objects, etc.... For more information about LINQ, visit this page, I don’t want to get deep into the details. You can get the sample ......