Tag | LINQ Posts

Today, I released LINQ to Twitter v2.0.8. Besides normal maintenance, this release includes the Twitter Geo API and the Suggested Users API. LINQ to Twitter is hosted on CodePlex.com: http://linqtotwitter.codepl... In addition to new functionality, I've made much progress toward LINQ to Twitter documentation; primarily in the Making API Calls area: http://linqtotwitter.codepl... There's also a discussion forum where you can ...
An ex-colleague of mine used to call his SQL script generator "Super-Scriptmatic 2000". It impressed our then boss little, but was fun to say and use. We called every batch job and script "something 2000" from that day on. I'm tempted to call this one Menu-Matic 2000, except it's waaaay past 2000. Oh well. The problem: I'm developing a bunch of stuff in MVC. There's no PM to generate mounds of requirements and there's no Ux Architect to create wireframe. During development, things change. Specifically, ...
LinqPad as we all know has been a wonderful tool for running ad-hoc queries. With Azure Table storage in picture LinqPad was no longer in picture and we shifted focus to Cloud Storage Studio only to realize the limited and strange querying capabilities of CSS. With some tweaking to Linqpad we can get the comfortable old shoe of ad-hoc queries with LinqPad in the Azure Table storage. Steps: 1. Start LinqPad 2. Right Click in the query window and select “Query Properties” 3. In The Additional References ...
There are many ways to generate a PowerPoint presentation using Open XML. The first way is to build it by hand strictly using the SDK. Alternately you can modify a copy of a base presentation in place. The third approach to generate a presentation is to build a new presentation from the parts of an existing presentation by copying slides as needed. This post will focus on the third option. In order to make this solution a little more elegant I am going to create a VSTO add-in as I did in my previous ...
Employee Info Starter Kit is a ASP.NET based web application, which includes very simple user requirements, where we can create, read, update and delete (crud) the employee info of a company. Based on just a database table, it explores and solves most of the major problems in web development architectural space. This open source starter kit extensively uses major features available in latest Visual Studio, ASP.NET and Sql Server to make robust, scalable, secured and maintainable web applications ...
Here is the scenario: You have a Windows Form Application that calls a method via Invoke or BeginInvoke which throws exceptions. Now you want to find out where the error did occur and how the method has been called. Here is the output we do get when we call Begin/EndInvoke or simply Invoke The actual code that was executed was like this: private void cInvoke_Click(object sender, EventArgs e) { InvokingFunction(CallMode.I... } [MethodImpl(MethodImplOptio... void InvokingFunction(CallMode ...
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 ...
Coming from someone who loves the KISS method, I was surprised to find that I was making something entirely too complicated. I know, shocker right? Now I'm no unit testing ninja, and not really a WCF ninja either, but had a desire to test service calls without a) going to a database, or b) making sure that the entire WCF infrastructure was tip top. Who does? It's not the environment I want to test, just the logic I’ve written to ensure there aren't any side effects. So, for the K.I.S.S. method: Assuming ...
In my last post I created a very simple WCF service with the user registration functionality. I created an entity for the user data and a DataContext class which provides some methods for operating the entities such as add, delete, etc. And in the service method I utilized it to add a new entity into the table service. But I didn’t have any validation before registering which is not acceptable in a real project. So in this post I would firstly add some validation before perform the data creation ...
Next week (17th March 2010) I am presenting on EF4 at www.devweek.com in London (and Azure on the 18th). Today I wanted to get all the latest bits on my demo machine and also check if there are any cool new resources I can point people at. Whilst most of the new improvements in Entity Framework come with the Visual Studio 2010 RC (and the RTM), there are a couple of separate items you need to install if you want to explore all the features. To demo EF4 you need: Visual Studio 2010 RC Download and ...
Update (14-Mar-2010): Updated the Whiteboard Demo I must have tried reading through the various explanations and introductions to the new Reactive Extensions for .NET before the concepts finally started sinking in. The article that gave me the ah-ha moment was over on SilverlightShow.net and titled Using Reactive Extensions in Silverlight. The author did a good job comparing the "normal" way of handling events vs. the new "reactive" methods. Admittedly, I still have more to learn about the Rx Framework, ...
In my previous example I have demonstrated how to create a simple form that would allow users to insert data to the database using L2S. In this example I’m going to demonstrate how to fetch and filter data from database and fill the fields in the form using L2S. This example is basically a continuation of my previous example here. So I would suggest you to take a look at my previous example first before you proceed reading this example. STEP 1: Setting up the GUI To get started, add a new WebForm ...
Few months ago, I’ve created a simple demo about “Creating a Simple Registration Form using the ADO.NET way”. In this article, I'm going to demonstrate how to create a simple form that would allows users to insert data to the database using L2S. As an overview, LINQ to SQL is a technology that allow you to query sql server. LINQ to SQL is an O/RM (object relational mapping) implementation that ships in the .NET Framework "Orcas" release, and which allows you to model a relational database using .NET ...
LinqPad as we all know has been a wonderful tool for running ad-hoc queries. With Windows Azure Table storage in picture LinqPad was no longer in picture and we shifted focus to Cloud Storage Studio only to realize the limited and strange querying capabilities of CSS. With some tweaking to Linqpad we can get the comfortable old shoe of ad-hoc queries with LinqPad in the Windows Azure Table storage. Steps: 1. Start LinqPad 2. Right Click in the query window and select “Query Properties” 3. In The ...
In Windows Azure platform there are 3 storage we can use to save our data on the cloud. They are the Table, Blob and Queue. Before the Chinese New Year Microsoft announced that Azure SDK 1.1 had been released and it supports a new type of storage – Drive, which allows us to operate NTFS files on the cloud. I will cover it in the coming few posts but now I would like to talk a bit about the Table Storage. Concept of Table Storage Service The most common development scenario is to retrieve, create, ...
INTRODUCTION If you are a SharePoint developer you know that there are two basic ways to develop against SharePoint. 1) The object Model 2) Web services. SharePoint object model has the advantage of being quite rich. Anything you can do through the SharePoint UI as an administrator or end user, you can do through the object model. In fact everything that is done through the UI is done through the object model behind the scenes. The major disadvantage to getting at SharePoint this way is that the ...
Chunking a List As I mentioned last time, I'm knee deep in python these days. I come from a statically typed background so it's definitely a mental adjustment. List comprehensions is BIG in Python and having worked with a few of them I can see why. Let's say we need to chunk a list into sublists of a specified size. Here is how we'd do it in C# static class Extensions { public static IEnumerable<List<T>... Chunk<T>(this List<T> l, int chunkSize) { if (chunkSize <0) { throw ...
Quick Links Adding Volcanos and Options - Earthquake Locator, part 2 Live Demo Source Code The recent wave of earthquakes (no pun intended) being reported in the news got me wondering about the frequency and severity of earthquakes around the world. Since I’ve been doing a lot of Silverlight development lately, I decided to scratch my curiosity with a nice little Bing Maps application that will show the location and relative strength of recent seismic activity. Here is a list of technologies this ...
In this Issue: András Velvárt, felix corke, Colin Eberhardt, Christopher Bennage, Gergely Orosz, Entity Spaces Team Blog, Mike Taulty(-2-), Jit Ghosh, and Jesse Liberty. Shoutouts: Jeremy Likness expands on the Silverlight Team's post Vancouver Olympics - How'd We Do That? Gavin Wignall has a post up Creating a 360 photograph of an object with Silverlight Photosynth From SilverlightCream.com: Transforming an Ugly Duckling into a Graceful Swan With Expression Blend and Silverlight - Part 2 Intro Animation ...
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. ...
Before I noticed how many other people had blogged about this same thing, I wrote an implementation of a "times" (integer extension) method -- the kind you'd find when coding in Ruby that is passed a block of code that it executes (n) times. Consider the following (in Ruby): ###########################... # prints: # Ruby was here # Ruby was here 2.times { printf("Ruby was here\n") } ###########################... # prints: # Ruby was here 0 # Ruby was here 1 2.times {|i| printf("Ruby ...
So… I am a C# coder at heart, but F# is starting to fascinate me. Today I thought I would try and figure out the basics of getting the two languages to talk to each other. From what I could tell on Stack Overflow, at least for now there will not be any Windows Forms / WPF exposed to F# (it is possible, but I am lazy and like VS to do as much as possible). Which leaves me thinking, where will I use F#. I can immediately see a use for it in the Business Layer of my applications – which would mean that ...
Silverlight at Visual Studio 2010 sample for simple binding a data to DataGrid. This sample is also for the beginners only. We will create a Databinding for DataGrid in a simple way using WCF and Linq to SQL. For more details: http://docs.google.com/Doc?... ...
Last time we saw some interesting initialization constructs possible with LINQ. Hope some of you have tried it out. If not, it’s never too late. LinqPad is a good friend in need. This time around we’d take a look at two common looping scenarios. 1. Looking up an object by name: Object lookup is commonplace while dealing with collections. Let’s look for an object with a given name. Previously we’d run a for each and come up with something like. public MyObject FindByName(string value) { foreach (MyObject ...
Since I am looking to get more involved with the development community, what better way to get started than to start attending and participating in the local user groups here in the Houston area. It's been a while since I've attended one of these things, but I do remember the free pizza and prize give-aways. Oh yeah, the topics and conversations are always good too! D2SIG - www.d2sig.org Silverlight 4 - What's New? Tuesday, March 2nd, 6:00 - 8:00 PM HDNUG - www.hdnug.org CodeSmith featuring PLINQO, ...
One of my major points of interest as a software developer is in the various tools that are available to make a developer’s life easier (or at least more interesting…). This is also a very important aspect for me in professional terms, because one part of my job lies in recommending suitable tools to my customers, implementing them and make them part of a developer team’s workflow. Thus, a well organized link collection is an important part of my assets and has a considerable business value for me ...
I was bored thinking of what my first blog post should be about, so I decided to interview myself (especially since no one else knows about this place, yet!)... Q: Where have you been? A: Well, it's been over two years since I last blogged about anything interesting, but since that old server has long since been retired, I decided to resurrect myself on a popular blog site (this one). Q: What have you been doing in the mean time? A: I have been working with several of the latest offerings from Microsoft, ...
Technorati Tags: General Pluralsight is an online .NET Training library which provides online training materials for .NET developers. Example trainings available on demand: · .NET 3.5 · Agile Team Practices · ASP.NET 3.5 · ASP.NET AJAX · ASP.NET MVC · BizTalk 2006 · BizTalk Server 2006 R2 · BizTalk Server 2009 · iPhone ASP.NET · LINQ · Managed Services Engine · Silverlight 3 · SharePoint Services · SQL Server 2008 · VSTS · WCF · Windows Server AppFabric, formerly "Dublin" · Windows Workflow · WPF ...
Last week, I needed to call the SQL Reporting Services Web Service to export reports as Excel, PDF, and Word formats. I could have used the [Add Web Reference...] as the MSDN Documentation Accessing the Report Server Web Service Using Visual Basic or Visual C#, but I decided to use [Add Service Reference...]. If you are wondering what the difference is between Web Reference and Service Reference, please read this blog post by Andrew Tokeley. Goal Create a common library project which I could reuse ...
LINQ as we all know provides intrinsic data querying capabilities to the framework languages supporting LINQ. Going forward its an obvious way to code clean, and with growing number of LINQ providers (LINQ to SQL, LINQ to Entities, LINQ to XML, LINQ for Maps, and not to forget DryadLinq and pLinq for us Cloudy folks’ Parallel Computing needs, and so on) it looks to be the de facto standard for querying within dotnet framework languages. Let us get acquainted to LINQ by taking a close look at the ...
While my home development computer is fried I’m going to hack away at my backlog of non-code related posts. Today I’d like to discuss some of the advantages and disadvantages of using Microsoft MVC over WebForms. First of all, MVC is not the end all, magical platform that many people would like you to believe. In fact I wouldn’t even recommend it to beginner developers. However, if you have experience with .NET and you’re willing to put in the time to learn how MVC works, you will find that it offers ...
I would like to make one of these entries for every example I don't find on MSDN. I'm not sure if the intention is to ignore C++ or if this was just expected to be too hard, too easy or too ugly for developers to grasp. I have submitted this as Community Content on MSDN, also. http://msdn.microsoft.com/e... Here is the missing example for Enumerable::ToList(); #include "stdafx.h" using namespace System; using namespace System::Collections::Generic; using namespace System::Linq; ...
There is a great article about Data Access in Silverlight by Shawn Wildermuth came out yesterday. The basic story of how Data Services works is that it takes a context object from a LINQ provider and exposes all the IQueryable endpoints as REST resources that can be queried. This works well in creating a place to execute queries and post/put/delete changes. The Silverlight (and .NET) client library allows you to just issue LINQ queries to the data service. Ability to create tracked projections from ...
The main purpose of this post is to show what's required in the main 3 .net languages for filtering and sorting. I decided to put these two problems together because they presented themselves to me simultaneously . There are many instances where I need to Sort custom objects and many instances where I need to filter out duplicates from a list of custom objects. For filtering (Distinct), the effect happens with the framework finds unique values for the object. For the Sort, the default comparer will ...
Just getting a few interesting cloud links “down on paper”. I last did one of these on Azure in Dec 2009. Not everyone seems to know that Roger Jennings does a rocking job of collating links on Azure – e.g. Sunday Feb 14th. Recommended read - Using SQL Server Client APIs with SQL Azure Version 1.0 Q&A: Looking Ahead at Microsoft's Cloud Strategy Tim O'Brien, director of Microsoft's Platform Strategy Group, discusses the future of Windows Azure, Silverlight, and developing with .NET. Getting MySQL ...
One of my previous posts talked about the performance improvements in WF4. With the recent release of Visual Studio 2010 / .NET 4 RC1, I thought I would re-run my performance tests to see if there have been any further improvements with the most recent version. My test is simply timing how long it takes to invoke an empty workflow (an Sequence activity that does nothing) 2,000,000 times. This test gives us a good idea of the overhead of invoking a workflow. With .NET 4.0 RC1, I am able to invoke ...
There are many times where I need to convert an array of data into a Dictionary or Hash table. If the key to be used in the new Dictionary is not unique, it is necessary to manage duplicates. I previously went through a lot of gyrations, but eventually setteled on the ILookup. ILookup is not perfect, but it beats some alternatives. Note this example (given the following structure): public static List<string[]> lst_arr_strData = new List<string[]>() { new string[] {"fred", "1"}, new string[] ...
I was recently having a discussion with @tyarmer and @g0t4 about what is necessary to sufficently test a method that determines the previous business day. There are quite a few unique scenarios that can come up. Here are a few: On a weekend, you should get Friday, unless it’s a holiday. On a Monday you should get Friday, again unless it’s a holiday If a day is holiday you should get the day before, unless that’s a holiday and a weekend And so on… Obviously there’s a bit of a pattern here I suggested ...

LINQ to BitTorrent is a custom .NET LINQ query provider implementation that translates LINQ queries into HTTP requests that accesses various BitTorrent search engine APIs and RSS feeds.

Full documentation will be posted here soon...

You can freely download the source code and/or binaries from the Codeplex site as well as view a live demo of the provider.

The Twitter Search API returns an XML Atom formatted feed. So, in LINQ to Twitter, I've created an Atom object, which I return when someone performs a search. The problem with the results is that the ID of the Status is mangled with other information. To solve this problem, you need to extract the status ID from the number following the last colon of the ID from the search Entry. Here's some code to show how it's done: private static void SearchAndUseStatusTwitterDe... twitterCtx) { ...
A lot of examples on LINQ to XML show how to translate from XML into objects. Especially with REST data sources, it seems like a lot of LINQ to XML is used to read XML. However, there is also a need to translate from objects to XML, which isn't always as intuitive. The following example shows a couple different ways to translate from objects to XML. It starts with a string for the XML document. There is also a List of Customer objects. This example translates the objects into XElement's and then ...
This is a continuation from Deployment of Theme and Resource files Resource File Deployment (Resx) The second item was deploying Resource files to the App_GlobalResource directory present as a subdirectory under each IIS site for each SharePoint Web Application zone. Remember that you can have multiple IIS Sites for each “Logical” SharePoint Web Application. The other requirement we had was that each Web Application needed to have its own set of resource files and were to be deployed and scoped as ...
Hi there, Today we will be doing a quick little test to send a XML message to BizTalk with few lines of code. I had a scenario in my solution in which I had a WCF LOB Outbound Adapter which was doing some work and later the same code had to submit message back to BizTalk. First solution I thought of was writing the message to a File Location and than a BizTalk Receive Location picks it up from there and processes it. But then came up with a different solution of using WCF netPipe and submitting it ...
This article is a two-part series regarding the LinqToWikipedia provider. The first article covers the basic concepts of Linq as well as the client usage of this particular provider while the second article covers the inner workings of the LinqToWikipedia provider to give you an understanding of what it takes to create your own IQueryable provider. NOTE: You should download the latest build from Codeplex so you can follow along with the code samples. Creating your own IQueryable provider First off ...
I came across and found very useful, bare in mind I am relatively new to the EF and TDD so any suggestions would be welcomed. I have been very busy recently with a new project, as I am in control of this project I have wanted to do things correctly from the start, I also am using it as an opportunity to get familiar with all the newest and shiniest of Microsoft's technologies. The platform is using a combination of ASP.Net MVC 2.0 and the Entity Framework 3.0. Because I know this codebase is going ...
I recently developed a WCF solution with SharePoint that once I deployed cause so many issues with memory leak that it service was shutting down. If you are having issues with a WCF service that hits the SharePoint object model and it is unexpectedly shutting down, most likely it is because memory leaks. I will not write about simple memory leaks since there are lots of great blogs which cover the topic really well. I have had issues with LINQ and SharePoint and I wrote several .Net method extensions ...
We're nearing the end of our second iteration on a new project. I started out by setting myself a few goals to explore. I'd like to write them down here, so I can come back in a few months to see what remains of them. You're welcome to comment on these goals.Overall- readable, intent revealing software- DRY, YAGNI, BOYSCOUT et all...Entities:- IAggregate root has interface- No ID (I'm not sure if I can pull this one off with NHibernate)- No (public) setters except for things like name, description, ...

I finally managed to publish a detailed tutorial about LINQ`s GroupJoin method which I promised long ago. Sorry for being so late   It is available here [DIRECT LINK]

The first annual Chirp has been scheduled for 14-15 April in San Francisco. Chirp is a conference, sponsored by Twitter, about the Twitter platform. http://chirp.twitter.com To attend the conference, you'll need to obtain the password by executing the users/show command. There are plenty of tools to help you do this if you have some degree of programming skill. Of course, there is a .NET LINQ provider, LINQ to Twitter, that can help perform this task with ease. In LINQ to Twitter terms, you would ...
In this Issue: Fredrik Normén(2), Antoni Dol, Alex van Beek, Rishi, Mike Taulty, Giorgetti Alessandro, Michael S. Scherotter, Jesse Liberty, Jeremy Likness, and Anoop Madhusudanan. Shoutouts David Kelley announces a podcast: Lunch With Interact - MVVM For Tards I don't keep a close eye on it, but sometime in the last two days, @SilverlightNews has hit 4000 followers... thanks to all the readers! From SilverlightCream.com: Aspen – A sample app using Silverlight 4 and .Net 4.0 – part 5 of X – New Repository ...