Max's Blog

.NET, SQL Server and other exciting stuff

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

News

Tag Cloud


Archives

Post Categories

Links

LINQ

There are 8 entries for the tag LINQ
Part 1 - Listing Data from Database: Let us now learn ASP.NET MVC 2 from Scratch by actually developing a front end website for the Chinook database, which is an alternative to the traditional Northwind database. You can get the Chinook database from here. As always the best way to learn something is by working on it and doing something. The Chinook database has the following schema, a quick look will help us implementing the application in a efficient way. Let us first implement a grid view table...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

In this post, we are going to look into implementing lists into our twitter application and also about enhancing the data grid to display the status messages in a pleasing way with the profile images. Twitter lists are really cool feature that they recently added, I love them and I’ve quite a few lists setup one for DOTNET gurus, SQL Server gurus and one for a few celebrities. You can follow them here. Now let us move onto our tutorial. 1) Lists can be subscribed to in two ways, one can be user’s...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

In this post, we will look at implementing the following in our twitter client - displaying the profile picture in the home page after logging in. So to accomplish this, we will need to do the following steps. 1) First of all, let us create another field in our Global variable static class to hold the profile image url. So just create a static string field in that. public static string profileImage { get; set; } 2) In the Login.xaml.cs file, before the line where we redirect to the Home page if the...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Finally Silverlight 4 RC is released and also that Windows 7 Phone Series will rely heavily on Silverlight platform for apps platform. its a really good news for Silverlight developers and designers. More information on this here. You can use SL 4 RC with VS 2010. SL 4 RC does not come with VS 2010, you need to download it separately and install it. So for the next part, be ready with VS 2010 and SL4 RC, we will start using them and not betas. With this momentum, let us go to the next part of our...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

We will create a few classes now to help us with storing and retrieving user credentials, so that we don't ask for it every time we want to speak with Twitter for getting some information. Now the class to sorting out the credentials. We will have this class as a static so as to ensure one instance of the same. This class is mainly going to include a getter setter for username and password, a method to check if the user if logged in and another one to log out the user. You can get the code here....
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

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...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati