Tag | LINQ Posts

From Feb 7th-9th I’ll be presenting two sessions at SPTechCon San Francisco 2011. My first presentation is a new session called “The Expanding Developer Toolbox for SharePoint 2010” which covers many of the new tools and functionality available to SharePoint 2010 developers. My second sessions is called “Real World Deployment of SharePoint 2007 Solutions” (presented at last SPTech Con Boston) which covers tips, tricks, and advice on deploying SharePoint 2007 solutions. If you hurry you may still ...
Adding Cache Dependency Support This second part of my article on adding cache support to applications will extend the sample application developed in part one to add support for cache dependencies such as the SqlCacheDependency. Part One of this article is at: http://geekswithblogs.net/R... ICacheDependency Interface We will need to pass cache dependencies to the Cache Provider implementation, so the first step is to create ...
In brief…. take 1 minute to register today if you are UK based and work for a company that creates software products and want to dig into SharePoint 2010 development for FREE with a great UK based SME (subject matter expert). And… if you want to understand the background, read on :-) Microsoft Platform Ready is where we are aggregating resources to help companies who develop software products explore and adopt the latest technologies from Microsoft. There are many benefits to signing up (e.g. the ...
Last time I posted something about getting all the host between a given IP Range. Part of the routine is to convert the IpAddress to its DecimalEquivalent. Tip: Asside from using the URL of a web site, you can use the Decimal version of the Ip address of the Host Name. Sample Google.com --> 74.125.71.105 you can use http://1249724265 Solution Version 1 public abstract class IpMath { public static Int64 ConvertToDecimal(string IpAddress) { Int64[] tmpIpAddress = SplitIpAddress(IpAddress); Int64 ...
I have been working on a Silverlight Navigation application which uses LINQ to query an XML data source and has been working without a hitch until I added a control to the landing page. All other pages which worked fine were loaded from the navigation service Once I added the control I got a page not found error! (The page is there) and If navigated to, it works as expected. What happens, it that I closed the error Modal dialog and then clicked on another page, then navigate back to the landing page ...
Recently UppercuT (UC) quietly released version 1 (in August). I’m pretty happy with where we are, although I think it’s a few months later than I originally planned. I’m glad I held it back, it gave me some more time to think about some things a little more and also the opportunity to receive a patch for running builds with UC on Linux. We also released v1.1 very recently (December). UppercuT v1 Builds On Linux Perhaps the most significant changes to UC going v1 is that it now supports builds on ...
I have been working to get a SharePoint development course delivered online in February and March – online means lots of opportunities to ask questions. The first dates are now in place. The training is being delivered as a benefit for companies signed up to Microsoft Platform Ready. It is intended for UK based companies who develop software products* Agenda: Day 1 (Live Meeting 3 hours) 1:30 - 4:30 • Getting Started with SharePoint: Understand why and how to start developing for SharePoint 2010 ...
ASP.NET applications can make use of the System.Web.Caching.Cache object to cache data and prevent repeated expensive calls to a database or other store. However, ideally an application should make use of caching at the point where data is retrieved from the database, which typically is inside a Business Objects or Model layer. One of the key features of using a UI pattern such as Model-View-Presenter (MVP) or Model-View-Controller (MVC) is that the Model and Presenter (or Controller) layers are ...
If we have to get data from the SQL database, the standard way is to use a receive port with SQL adapter. SQL receive adapter is a solicit-response adapter. It periodically polls the SQL database with queries. That’s only way it can work. Sometimes it is undesirable. With new WCF-SQL adapter we can use the lightweight approach but still with the same principle, the WCF-SQL adapter periodically solicits the database with queries to check for the new records. Imagine the situation when the new records ...
It seems that the Snippet Compiler is not maintained anymore. So I need an alternative – also for getting syntax highlighting for code in publications. Preferable with the possibility to conserve this highlighting by copying selections to clipboard. Snippet Compiler does not allows this for selections – only by exporting the whole file content to clipboard with HTML- or RTF-formatting (File > Export > HTML to clipboard respectively RTF to clipboard). Today I switched to LINQPad. This application ...
XML has been a pervasive tool in software development for over a decade. It provides a way to communicate data in a manner that is simple to understand and free of platform dependencies. Also pervasive in software development is what I consider to be the anti-pattern of using string manipulation to create XML. This usually starts with a “quick and dirty” approach because you need an XML document and looks like (for all of the examples here, we’ll assume we’re writing the body of a method intended ...
Introduction The way I previously created messages to send to the GovTalk service I used the XMLDocument to create the request. While this worked it left a number of problems; not least that for every message a special function would need to created. This is OK for the short term but the biggest cost in any software project is maintenance and this would be a headache to maintain. So the following is a somewhat better way of achieving the same thing. For the purposes of this article I am going to ...
Today, I'm going to talk about a touchy subject: the notion of working in a company that doesn't use the prescribed "best practices" in its software development endeavours. Over the years I have, using a variety of pseudonyms, asked this question on popular programming forums. Although I always add in some minor variation of the story to avoid suspicion that it's the same person posting, the crux of the tale remains the same: A Programmer’s Tale A junior software developer has just started a new ...
I feel compelled to post this blog because I find I’m repeatedly posting this same code in silverlight and windows-phone-7 answers in Stackoverflow. One common task that we feel we need to do is burrow into the visual tree in a Silverlight or Windows Phone 7 application (actually more recently I found myself doing this in WPF as well). This allows access to details that aren’t exposed directly by some controls. A good example of this sort of requirement is found in the “Restoring exact scroll position ...
In this Issue: John Papa, Tim Heuer, Jeff Blankenburg(-2-, -3-), Jesse Liberty, Jay Kimble, Wei-Meng Lee, Paul Sheriff, Mike Snow(-2-, -3-), Samuel Jack, James Ashley, and Peter Kuhn. Above the Fold: Silverlight: "Animation Texture Creator" Peter Kuhn WP7: "dows Phone from Scratch #13 — Custom Behaviors Part II: ActionTrigger" Jesse Liberty Shoutouts: Awesome blog post by Jesse Liberty about writing in general: Ten Requirements For Tutorials, Videos, Demos and White Papers That Don’t Suck From SilverlightCream.com: ...
In 2009 Microsoft released a case study about a project that we had done using the OOXML SDK 1.0 for Research Directors Inc. Since that time Microsoft has released version 2.0 of the SDK and PSC has done significant development with it. Below are some of the mile stones we have reached since the original case study. At the time of the original case study two report types had been automated to output as PowerPoint presentations. Now that the all the main products have been delivered we have added ...
.NETTER Code Starter Pack contains a gallery of Visual Studio 2010 solutions leveraging latest and new technologies released by Microsoft. Each Visual Studio solution included here is focused to provide a very simple starting point for cutting edge development technologies and framework, using well known Northwind database. The current release of this project includes starter samples for the following technologies: ASP.NET Dynamic Data QuickStart (TBD) Azure Service Platform Windows Azure Hello World ...
MapReduce See http://en.wikipedia.org/wik... The MapReduce pattern aims to handle large-scale computations across a cluster of servers, often involving massive amounts of data. "The computation takes a set of input key/value pairs, and produces a set of output key/value pairs. The developer expresses the computation as two Func delegates: Map and Reduce. Map - takes a single input pair and produces a set of intermediate key/value pairs. The MapReduce function groups results by key and passes ...
What is ULS in SharePoint 2010? ULS stands for Unified Logging Service which captures and writes Exceptions/Logs in Log File(A Plain Text File with .log extension). SharePoint logs Each and every exceptions with ULS. SharePoint Administrators should know ULS and it's very useful when anything goes wrong. but when you ask any SharePoint 2007 Administrator to check log file then most of them will Kill you. Because read and understand the log file is not so easy. Imagine open a plain text file of 20 ...
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 ...
In this Issue: András Velvárt, Kunal Chowdhury(-2-), AvraShow, Gill Cleeren, Ian T. Lackey, Richard Waddell, Joe McBride, Michael Crump, Xpert360, keyboardP, and Pete Vickers(-2-). Above the Fold: Silverlight: "Grouping Records in Silverlight DataGrid using PagedCollectionView" Kunal Chowdhury WP7: "Phone 7 Back Button and the ListPicker control" Ian T. Lackey Shoutouts: Colin Eberhardt has some Silverlight 5 Adoption Predictions you may want to check out. Michael Crump has a post up showing lots ...
Let’s say that you have a list of objects that contains duplicate items and you want to extract a subset of distinct items. This is pretty straight forward in the trivial case where the duplicate objects are considered the same such as in the following example: List<int> ages = new List<int> { 21, 46, 46, 55, 17, 21, 55, 55 }; IEnumerable<int> distinctAges = ages.Distinct(); Console.WriteLine("Distinct ages:"); foreach (int age in distinctAges) { Console.WriteLine(age); } /* This ...
This post is about VS 2010, go here for the VS/TFS 11 extensions. UPDATED Apr 9th 2012: VersionInfo, NuGet, Code Contracts UPDATED Oct 7th 2012: New Visual Studio GDR UPDATED Aug 31th 2012: New versions updated of ReSharper, NDepend, Web Essentials, Community Build Manager, Code Contracts (March 2012), NuGet, ILSpy, DotPeek, Just Decompile, tangible T4 editor, LinqPad. Added the VersionInfo tool, so you know you have the latest update of VS 2010 UPDATED April 20th 2012: New version of NuGet manager. ...
So Silverlight Firestarter is over and your sitting on your couch thinking… what now? Well its time to So how exactly can you pimp the Silverlight Firestarter? Well read below and you will find out: 1) Pimp the videos: First we are going to use a program named Juice to download all of the Silverlight Firestarter videos. Go ahead and point your browser to http://juicereceiver.source... and download the application. It works on Mac, Linux and PC. After it is downloaded you are going to want ...
If you haven’t already signed up, there is a Silverlight Firestarter event happening today and kicks off in a little under an hour! Sign up here!!!!! ScottGu starts of with a keynote entitled “The Future of Silverlight”. Sounds like a good thing. Here is the rest of the agenda(All Times PST): 9:00 am Scott Guthrie The Future of Silverlight 10:45 am Jesse Liberty Data Binding Strategies with Silverlight and WP7 11:30 am Yavor Georgiev Building Compelling Apps with WCF using REST and LINQ 12:15 pm ...
All-In-One Data Platform Code Samples Introduction Download Data Platform code samples Request Data Platform code samples Introduction The All-In-One Data Platform code samples demonstrate the typical programming topics about ADO.NET, Entity Framework, WCF Data Services, ADO, and other Data Platform technologies. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration ...
Another nifty little feature in C# is anonymous types. Anonymous types allow a “short cut” in creating an object with a set of properties. They seem to be used mainly in LINQ, however we will make up a scenario here. Assume you have a situation where you want to group a whole bunch of information, but you don’t want to go to the effort of defining a class or a structure. You can get around this by declaring an anonymous type. Lets have a look at some code… var person = new { Name = "Mark", Surname ...
This evening I thought I would look into something that I have been meaning to look into for a while, but just haven’t given the time of day. Initially I wanted to brush up on some LINQ, but after going over the definition of LINQ, I stumbled across extension methods… I have heard of them quite a bit – but never really bothered to see what they are… So the official MSDN explanation says the following… “Extension methods enable you to "add" methods to existing types without creating a new derived ...
When you design a local SSRS report you are forced to use a Dataset as part of the design process, however, this does not mean that you have to keep the dependancy on a dataset or even retain the dataset in your project once you have completed the design. Simply use code similar to the C# example that follows to clear the dataset the report is expecting to use and specify the new collection of data it is to use instead: var context = new AWEntities(); var vendors = from v in context.Vendors where ...
I presented Windows Phone 7 talk on Microsoft Virtual tech Days (VTD) [22/11/2010] and here are the demo and the slide deck I referred to. Please feel free to download and refer. It covers: —Introduction to Windows Phone 7 —Tools for Development on Windows Phone 7 —Using Silverlight for WP7 development —Navigation among pages of application —WP 7 application lifecycle —Launchers and Choosers — Tombstoning —Fetching data from server using ODATA service (using LinqPad 4) —Deployment model of WP7 application ...
I was lucky enough to attend Visual Studio Live! in Orlando on November 14th-17th. There were so many great speakers and the networking was great. I met a lot of really cool people and we talked about everything .NET (from WP7, Silverlight, C#, ASP.NET WebForms, AJAX, MVC 3.. and so forth). I took a lot of notes during all the sessions and wanted to provide it to those that could not come out. If you follow me on Twitter then you have seen most of these. Most of the authors put slides/source code ...
The TPL (Task Parallel Library) of NET 4 contains a plethora of datatypes for implicit / explicit data and task parallelism + several synchronization primatives. Of course, when you learn something, its never the end of the story… http://code.msdn.microsoft.... contains a class library which leverages and complements the functionality available in the .NET Framework 4 TPL. Please find below my spelunk into this class library: Parallel General Extensions AggregateExceptionExtensions ...
If you generate CAML using LINQ to SharePoint in Visual Studio 2010 then you might see this bug popup: If you are writing a CAML query to filter records based on Date and Time, and this query is generated using LINQ To SharePoint then you will get the following CAML query generated: <View> <Query> <Where> <And> <Eq> <FieldRef Name='Title' /> <Value Type='Text'>{0}</Valu... </Eq> <Lt> <FieldRef Name='QuoteTime' IncludeTimeValue='TRUE' /> ...
So I had a great time at this past weekend's Central Maryland Code Camp (CMAP). I was honored that the organizers chose two of my talks for their schedule (Intro to Threading and A Beginner's Guide to LINQ). I have to admit that I didn't manage my time very well with the Intro to Threading talk; and, as a result, I didn't really get to my favorite code samples. But I feel like I came back strong with my LINQ talk and managed the clock pretty well. We'll see when the evals come in. My session materials, ...
The C# Programming Language, Fourth Edition by Anders Hejlsberg, Mads Torgersen, Scott Wiltamuth, and Peter Golde Publisher: Addison Wesley (Special Annotated Edition for C# 4.0) I can honestly say I have had a copy of this book for each edition it was published. I love this book and have always loved it. Ever since Microsoft stopped publishing the White Reference Guides we used to all have back in the day, Addison Wesley has became my reference book dealer. These White cover books with the most ...
Last week we discussed returning immutable POCOs from an enclosing class so that you can prevent someone who asks for your class’s data to mutate it out from under you. Now we’re going to get a little more complex and talk about returning immutable collections from an enclosing class for the same reasons. I will discuss several different methods for returning collections in a read-only fashion with their pros and cons, including performance implications. The Problem Many times you will create a type ...
My coworker John Sonmez had a great blog post recently illustrating how to refactor a switch statement. In short, he outlined how to take a switch statement covering all known values of a C# Enumeration and convert it into a Dictionary “map” object allowing you to quickly determine what action to take given any valid enumeration value. I really like this approach as I think it leads to more readable code. The one thing that’s always bothered me about enumerations though is that they can change with ...
I didn’t go to the Microsoft’s PDC Professional Developer’s Conference (PDC) this year because it was, as far as I could tell, a made-for-streaming video event. As such, I watched the keynote about 24 hours after it took place and used my Media Center PC to watch it on my plasma television. And I have to say, the keynote was worthy of the medium. Not only did the Silverlight Smooth Streaming technology deliver a fine HD image, but the content of the keynote itself, merited a big screen, and necessitated ...
If you are like me, you may have been surprised when you read the MSDN documentation for System.Activities.Statement... A Parallel activity operates by simultaneously scheduling each Activity in its Branches collection at the start. It completes when all of its Branches complete or when its CompletionCondition property evaluates to true. While all the Activity objects run asynchronously, they do not execute on separate threads, so each successive activity only executes when the previously ...
I had the opportunity to return to the Patterns and Practices Summit this year for the second time. The first time was in 2008, and they managed to plus that experience this year. All of the technology was on track, and par, for what Microsoft has been pushing toward us - 2010 being a huge year for major releases as well as out of band stuff. The presenters did an awesome job presenting and here are/were my favorites for this year. Monday (Workshops) Azure (@ScottDensmore, Eugenio Pace (think Pa-ch`ay) ...
The Little Wonders series received so much positive response I decided to make it a recurring theme in my blog as new ones popped in my head. There are two simple, yet great, LINQ extension methods you may or may not know about, but that can really simplify the task of converting collection queries into collections: ToDictionary() and ToList(). Introduction: LINQ and Deferred Execution Depending on your knowledge of LINQ, you may be oblivious as to what many of these query expressions do behind the ...
At a high level, this is how I understand the different MVC tiers: Model: Data libraries such as entities, Linq to SQL classes, or any other data library. View: The .aspx/.ascx pages. The classic ASP style code goes here. I have heard this layer referred to as a ‘report’ where you have as little logic as possible, and only that related to the display of the page. Controller: If you are coming from ‘standard’ ASP.Net and are new to MVC, You could say the controller is what replaces the code behind. ...
After I posted my last blog post, Ralph Squillace responded with a link that everyone that is doing OData/WP7 development should be aware of. 2 days before I posted my Data/WP7 post, Microsoft's Mike Flasco posted this regarding the changes that are coming in the RTM version of the Windows Phone 7 library. The current WP7 phone platform is missing some core types, types that data service client LINQ provider requires to function properly. The CTP that is currently available (and which my example ...
I received (by chance, mostly) a Netduino last tuesday. Netduino is an open-source hardware project based on Arduino and the .Net Micro Framework. And it’s extremely cool. I’m a C# developer and I was always interested in electronics. This is an excellent tool to start to understand that incredible world. I was about to buy an Arduino when the Netduino fell on my lap, so I was really happy about it. Netduino has various disadvantages over Arduino (for starters, it’s more expensive, not all the shields ...
There was a bonus second Virtual Brown Bag meeting this week - The boys from Texas had a lunch meeting at the Houston TechFest, and shared it via LiveMeeting. This week's topics: Tools for "a more readable web": InstaPaper and "Readability" Favorite things learned at VBB meetings George Mauer discussed some advanced LINQ methods: SelectMany and Aggregate Links and video recordings: Thursday's meeting: https://sites.google.com/si... Saturday's meeting: https://sites.google.com/si... ...
Our West Palm Beach .Net User Group will be honored to have Scott Klein, Microsoft MVP and Author of Pro. SQL Azure (APRESS) as our October speaker. Scott will be talking and answering all our questions about Azure. Time has never been better for our Fladotnet West Palm Beach .Net User Group. We are fortunate to have a free meeting location offered to us by CompTec and to enjoy the backing and sponsorship of many top notch companies. This support is enabling us to uphold our founders’ vision: Create ...
Extension methods were introduced with the .NET 3.5 framework as a mechanism to add methods to extend existing types without modifying the original assembly. This is how the Linq methods were implemented to enable some very powerfull predicate function based operations to be performed over all existing collection types. Searching for web controls on a page is one of those tasks that seems to come up for all kinds of reason while programming using web forms. I was reminded of this problem recently: ...
Update: I have now placed the zip containing the source for the end result of part 1 and 2 of this service template here. Two weeks ago I began the series with a discussion on how to make a new C# Windows Service template that is “debuggable” (you can find the article here). I had then intended the next week to follow up with a discussion on how to modify that template to make the service “self-installing”. Unfortunately, with my work schedule I wasn’t able to complete the series last week due to ...
Yesterday, I released LINQ to Twitter Beta v2.0.14. This includes entities, bug fixes, and the new Raw Queries feature. Please visit the LINQ to Twitter page for more info: http://linqtotwitter.codeplex.com/ Joe
Today, I added a new extensibility feature to LINQ to Twitter, called Raw Queries. The Twitter API has historically changed suddenly and without warning, leaving 3rd party libraries, such as LINQ to Twitter deficient in full support. On occasion, LINQ to Twitter encounters bugs that leave users without a means for accomplishing specific tasks. Therefore, we need work arounds to allow users to quickly adapt to changes and new features. Raw queries include two points of extensibility: the ability to ...