Tag | LINQ Posts

This is one of a series of posts on my preparations for sessions on Azure and ORMs at Software Architect 2009. The plan vs actual for day five (The last day): Play, play, play with the technology. PART DONE Produce outline skeleton demo sequence for both sessions PART DONE Produce a backup VM “just in case” :) DONE Run through both presentations for rough timing (mainly to figure out talk to demo ratio) PART DONE Look into this annoying bug which appeared to have started after I installed Silverlight ...
Problem Statement: To Evaluate a complex expression in dotnet and show the result to end users. The expression could be something like this X2 +Y3+Log10 (z) . Solution: There are different ways to solve the problem stated above. Am planning to show how to use Scripting Engines like Jscript/VBScript inside C#. We can make use of Windows Script Control to achieve this. Windows Script control can be downloaded from MSDN site. It is shipped as an Activex control which lets you make use of JavaScript ...
C# in Depth is not for beginners. It assumes a working knowledge of C# 1.0, and is not so much a tutorial of C# 2 and 3 features as an in-depth examination of how and why they work. I don’t think I learned anything I didn’t know about using generics, extension methods, delegates, anonymous methods and lambdas, but Skeet does a great job of zooming in on the inner workings of each of these features, building up to the big picture of how they all snap together to make the game-changing programming ...
Cet article concerne Visual Studio 2010 Beta1. Les informations peuvent ne pas être véritables lors de la sortie de la version finale du produit. La procédure suivante permet de créer un workflow simple et de le déployer dans IIS 7. Créer un nouveau projet dans VS 2010 : File | New | Project… Créer un projet de type Declarative Flowchart Service Library : Un projet de service sera alors créé possédant un nouveau service Service1.xamlx. (Normalement, dans les versions ultérieures, il ne devrait plus ...
Lambda expressions are yet another one of those things that took me a while to really embrace/ understand but once I did, I use them exclusively in LINQ. The reason it took me a while to finally start using them is because every time I tried to read an explanation of them, the author got bogged down in a ridiculous amount of details and explanations that I either got lost, or just lost interest. Once I learned how to use them, I found it was easier to go back and re-read those explanations and understand ...
This is one of a series of posts on my preparations for sessions on Azure and ORMs at Software Architect 2009. The plan for day three: Nearly got it all done. However I ended up spending more time on EF4 than I had planned as … there is a lot of it! Gather up good posts and samples for EF 4 (will likely blog this out) DONE Play with EF 4 as much as my day allows DONE Revisit EF 4 deck post play DONE And a late night re-read of the three Azure storage documents from way back (will add links in the ...
This is one of a series of posts on my preparations for sessions on Azure and ORMs at Software Architect 2009. [Initual release 22nd Sept 2009] [Updated 23rd Sept, with links from Julie Lerman] [Updated 2nd Oct, with slidedeck section] [Large Update 15th Dec – including PDC09 content, my new posts and plenty of stuff from Julie L, Tony and others] This is my attempt to pull together all (ok – most) of the improvements in Entity Framework 4.0 and aggregate useful resources against each. It is very ...
Got bit by a bug caused by me trying to do stuff smartly in Linq. Gentle reminder that Linq expressions are always recalculated. The bit of code is the following: public static void AddKnownTypes(IEnumerable&l... knownTypes) { // We only want to collect types that are new (hasn't been registered yet) IEnumerable<Type> newTypes = knownTypes.Where(t => !_knownTypes.Contains(t)); _knownTypes.AddRange(newTyp... // Fill in a dictionary of these newly added types foreach (Type type in ...
ASP.NET MVC Reports in ASP.NET MVC Integrating OpenID in an ASP.NET MVC Application using DotNetOpenAuth Microsoft Chart Controls to PDF with iTextSharp and ASP.NET MVC Setting Up ASP.NET MVC with NUnit for Visual Studio 2008 Standard Edition ASP.NET MVC ExtJS using LINQ Using ExtJS Grid with ASP.NET Ajax WCF WebServices & C# How To Get Started With Selenium Core And ASP.NET MVC ASP.NET MVC Cheat Sheets ASP.NET How to Implement Trackback Handler in ASP.NET How to Implement Pingback Handler in ...
I’m trying to be a better developer, so I try to make sure I follow best practices as much as I can. At times when I’m just creating simple methods though, every now and then I get somewhat hung up as to what do I use as types for my input parameters and return values. You see, it is something that is so basic, we create methods all the time, but most of the time, we don’t pay much attention to it since we’d just like to continue on with the task at hand. So I’m writing this to remind myself that ...
I tend to always have side projects going on. I think many developers are like this, either because we want to learn new things or have the opportunity to work on things that directly interest us or to make a little extra cash. Two of my side projects are the Pathfinder Project and Zombie Apocalypse. Pathfinder Project There are two kinds of companies in the world: the ones that listen to what consumers want and give it to them, and the ones that shove what they want to give you down your thoat and ...
I am visiting beautiful city of Nashvillie, TN, US and involoved in rather interesting project involving WCF, silverlight and SQL server 2008. Also being used are Search server (FAST) / Lucene .Net Omniture (for Web analytics) Integration with Community server, Twitter, Facebook Velocity – Distributed caching. MemCache – Web server Cache I am also planning to use Nikhil’s MVVM Silverlight Fx at silverlight end or MEF LINQ / Enity framework - for ORM. That remind me of scenario where i had to register ...
This weekend i was engaged with a rather uninteresting conversation with my wife. My wife is computer savvy but still is catching up on new technologies. Below is a brief snippet. I am hopeful that this will give you some idea on SAAS. Me: ok... Wife: What? you said something? me: Nothing. I was just talking aloud... its about SAAS. Wife: SAAS??? (for the less informed.. SAAS means mother-in-law in hindi !!!). Are you watching those hindi serials lately? me: Well, SAAS is a Acronym for Software As ...
One of my colleague remarked that LINQ is "VERY SIMILAR" to TSQL. However, he also cursed that why the LINQ guys have implemented it "reversely". What he meant that why the Select is reversed… SQL query will be 1: Select Name from Employee where sal > 80000 LINQ 1: var q = from emp in Employee 2: where emp.sal > 80000 3: Select emp; I cant help but giving him references to Korth & Sudarshan and mathematical Projections… That also reminded me of taking a quick tour of algebra which i am ...
Dependency properties is one concept which i always marvel. As programmer / developer i always like the concept, as by just introducing DP, so many stuff now is so easy(Read Template programming in XAML). DP is called a BEAST (in Silverlight and WPF) for reasons of complexity involved in understanding them. Also, of course, because they are so powerful language paradigm. I sometimes do think DP did not actually got their due. I mean, so many efforts is gone into explaining Lambda expressions, LINQ, ...
Well, here we are again. Last time, we talked about project structure and came up with the one we’ll use for this series. Next we’ll talk tools. We’ll talk tools like Tim Taylor talks tools: with lots of grunts for my favorites and only a little explanation about what the tools do.) This is mostly because there is LOTS of material on the interwebs about all of these tools. I tend to favor the tools that are the most widely used for two main reasons: they have been battle tested by the largest crowd ...
Just a quick tip that I found handy while doing some writing yesterday; chances are if you’ve played with LINQ you probably wrote something like this… var outputString = from s in inputString where s.Length > 1 select s; //Do some stuff with outputString in your method... Code like the above will work perfectly well if what you’re going to work with your implicit variable, outputString, within the body of the same method. But, as it stands, you can’t return outputString, or any implicit variable ...
Turing Project Page: [Novice: 9 | Advanced: 6 ] FAQ | Table of Contents | Definitions What is this and where do I start? [Reposted here while my primary blog is sorted out ] From Database to DataGrid The next step in Project Turing is to create a first iteration of the Silverlight application that will retrieve data from our database. Using our technology of choice: the Data Entity Framework coupled with .Net RIA Services. .Net RIA Services will allow us to create business logic on the server and ...
I was just reading a post on Donald Belchman's Blog today, as part of his series of "Development Project Archetypes", and one of them was on the "Ooo.... Shiny...." developer. An incestuous cousin to the Front of the Magazine Architect, this developer is easily distracted by any new technology. Not only will he want to talk about it endlessly, the ‘Oooo…Shiny!’ Developer will simply add the technology to the project without telling anyone. You will find, scattered through the code base, a number ...
Since most of the applications that I create are distributed accross a WAN that spans the country I am really big about minimizing the bandwidth usage of my applications. That typically means serializing and compressing the large chunks of data that go across the wire. My most recent application is using LINQ to SQL. However, its only using Stored Procedures since that was a requirement passed down "from above". Today I wanted to start minimizing that bandwidth footprint of my application and serialize ...
I had looked up the LoadControl(“”) method earlier today, and came upon a short website entry that quickly discussed how to load a web user control (.ascx) dynamically onto a page. The link is: http://www.codeproject.com/... It mentioned inside that a CMS (content management system) could be built using this method + a database table to track these controls. It got me intrigued, so I decided to pursue it. It’s pretty simple, and actually adds a lot of cool functionality ...
All thanks to Andrew for sharing for this idea, I just trimmed it down a bit: using System;using System.CodeDom;using System.Data.Linq.Mapping;using System.Web.Compilation;using System.Web.UI;using System.Text.RegularExpressi... LinqLength{ [ExpressionPrefix("LinqLenq... public class LinqLength : ExpressionBuilder { public override CodeExpression GetCodeExpression(BoundProp... entry, Object parsedData, ExpressionBuilderContext context) { return new CodePrimitiveExpression(Reg... ...
LINQPad... Simply Awesome, It is to databases what Kaxaml is to WPF. You have REALLY got to check this out. http://www.linqpad.net Amazing little application keep me quite organized and helps me remember those things that I find hard to remember. Evernote Here’s their tour video: ...
I'm happy to announce that I've launched a new project examining the creation of a business application from design to implementation using Silverlight and such related technologies as Linq, Entity Framework, RIA Services and more. This project is being documented on two levels: Targeted at intermediate Silverlight programmers. Targeted at novice Silverlight programmers to accomplish this, the documentation has next and previous markers for each track, and I've created a Table of Contents for locating ...
This example shows the basic way on how to populate a data from database to a ListBox/DropDownList control using LINQ to SQL. Note that I used Northwind database here just for the simplicity of this example. To get started then let’s go ahead and add a new item in your website application in Visual Studio 2008 or VWD Express 2008. To do this, just right click on the web site -> select Add New Item -> and on the Templates select LINQ to SQL Classes as shown below and click ok: Now open up Server ...
In this Issue: CorrinaB, UXPassion, and Nikhil Kothari Shoutouts: Frank La Vigne cracked open the SketchFlow Feedback File Format using my favorite editor :) ... oh you just know we're going to see toys dealing with that! Walt Ritscher's Shazzam is getting some legs: Shazzam – as Seen in Silverlight 3 Programmers Reference ... congrats Walt! From SilverlightCream.com: Silverlight 3 Application Themes Unless you've not been around Silverlight, you know CorrinaB is the genius behind all the great themes, ...
Emad Ashi (@splashup on twitter) interviewed me in the 5th episode of his first Arabic podcast series DotNetArabi to talk about Object Relational Mapping in .NET in Arabic. Podcast Page: Mohamed Meligy Talking about ORMs (MP3 Direct Download) ?????? ????? ??????? ????? ??? ??????? ??? ???????.. ?????? ?? ???? ?? ??? ???? ?? ??? ???????? - ? ???? ??? ???? ?? ??? ???????? ????????? ?? ??? Object Relational Mappers – ORMs ???? ????? ?? “???? ?????” (splashup@ ??? ?????) ??? ???????? ?? ?? ???? “??? ...
I try to spend a little time every day brushing up on my developer skills. Some days I have more success than others. I might attempt to brush up on my skills by reading a tech book (currently working through "Working Effectively with Legacy Code" by Michael C. Feathers, I'm loving that book!), practicing some new language features (I'm still wrapping my head around lambda expressions and LINQ) or just browsing tech blogs and listening to tech podcasts. I do this partly because our industry changes ...
When working with WPF projects in Visual Studio, you can add WPF Windows, Pages, User Controls and Resource Dictionaries to a project by right clicking on the project and selecting Add > Window..., Add > Page..., Add > User Control... or Add > Resource Dictionary... menu options. The problem I run into is that these menu options are only available if you selected one of the WPF project templates when adding the project to your solution. How can we add WPF items to existing projects in ...
So this is one of those things that has slipped past me for all these months and now that I’ve discovered it, I can’t believe I went without it. I recently found out that I can access a business object in the ItemDataBound event of a ListView which makes it way easier to do some last minute control changing (such as binding labels or hyperlinks, etc.) In my example, I have a LINQ to SQL class called Question. My ListView hooks up to a datasource of IEnumerable<Question> and displays its properties—nothing ...
In this Issue: Paulio, Jesse Liberty, René Schulte, Pete Blois, Benjamin Roux, UXPassion, Pencho Popadiyn, Kris Meeusen, Scott Marlowe, and Matthias Shapiro Shoutouts: The UXConnection has this interesting Expression Design post up: [Mini-Tutorial] Working with Images in Expression Design I got a link sent to me for SilverBoom - Public Beta to Convert Adobe Flash files to Microsoft Silverlight/WPF From SilverlightCream.com: Using Blend to set the colour of the text in a button If you've tried to ...
On Tuesday night (August 25), I will be presenting “C# 3.0 Deep Dish with a slice of C# 4.0” at CapArea .NET User Group (but I have to give Brian Noyes credit for the catchy title). The primary content of the presentation will be a deep dive into the C# 3.0 language features. The latter part of the presentation will be an overview of the features coming in C# 4.0. Hope to see you there. Additionally, the next night (Wednesday, August 26), I’ll be at FredNUG presenting Linq to SQL ...
Create a rss or atom feed is very simple in asp.net mvc. In V1.0 there isn’t a build-in mechanism to work with feeds, however we can very quickly build our own. All we have to do is create a xml structure accordance with their specification and new ActionResult derived class to handle the result. But let’s start form beginning. The first of all, we need to create a new MVC project and call it e.g. RssFeed. The data for feeds will be taken from database, so we have to build model. Let’s create a new ...
Microsoft Interoperability team announced an release of the new project which is the bridge between PHP and.NET and erases bounds of technologies even more. This project allows developers on PHP even more easier to access and use all power of .NET services which based on ADO.NET Data Services. From the point of view of working out the scheme looks classically enough. By working out it is necessary to use utility PHPDataSvcUtil which is in PHP Toolkit for ADO.NET Data Services. This utility will generate ...
In this catching-up Issue: Brad Abrams, Matthias Shapiro, Jesse Liberty, Walt Ritscher, Erik Mork, Gavin Wignall, Tim Heuer, Rob Zelt, Jeff Prosise, and Dan Wahlin. Shoutouts: The Expression Blend and Design blog reports All Expression Blend Samples Posted to the Expression Gallery! Rob Zelt reminds us to Remember the Silverlight Toolkit! In case you missed this one, it's huge: Sunday Night Football - Powered by Silverlight congrats to all involved with that one!! From SilverlightCream.com: Business ...
During my project that is heavily centered around web services, I often found that before I could execute one overall integration, I would need about 3 or 4 web Service calls to collect all the parameters I needed to actually call the web service call I was really trying to execute. I came across an interesting situation where I need to retrieve the List from SharePoint. A web service call will send back an XMLElement with all the information available for a list. The problem is that the list needs ...
What is LINQ? LINQ == Language Integrated Query I been trying to learn more about LINQ and searching the Internet until I found this link Introduction to LINQ Also, this is a great link to LINQ Tutorial: http://dotnetslackers.com/a... ...
UPDATE dated August 17, 2009 Once I posted this entry, there is a lot of interest that has been shown and few queries as well. So I thought I need to update this post. This is only the first post in the series on ASP.NET 4.0 fetaures. There are lot of ground breaking things and other enhancements that are pretty exciting. To the folks who asked for "why MS changing dev platform once in 18 months" There is no change. there are a few enhancements. Post .NET 2.0 there have been a lot of additional APIs ...
I have looked at LINQ and still get this uneasy feeling that it is definitely a love/hate relationship, but I figure I would ask the community on their views on it. Here are my personal issues with it that is steering me away from it currently to be used as a main driving framework of a brand new project: LINQ is a framework in which I may not agree with how it handles all the "voodoo" behind the scenes which can lead to developers believing it is the next thing to sliced bread. I agree it does add ...
(this is a repost since the initial post had a few issues that couldn’t be corrected) I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1. It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort. To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1. You can install both from http://msdn.microsoft.com/h... ...
I pretty new to LINQ, and I’m keen to get more experience using it, so whenever an opportunity arises I like to try writing LINQ queries. I needed to write a method to extract a comma separated list of numbers from a config file, and return this as List<int>. I was looking at ways to do this using LINQ, but hit a problem. I wanted my LINQ query to filter out any values in the CSV string that could not be parsed as an int, without causing an exception. Using int.TryParse() seemed like a possible ...
I'd like to compare the java language to .net as I'm experiencing it. First of all, I'd like to point out that the differences are less than the similarities. Purely seen from a syntax point there really are no differences. Except of course if you're used to .net 3.5. This is irritating at first, but after a while you're just resigned to it. Take the simple properties we're so used to in .net Compare these two identical pieces of code: java: private int counter; public int getCounter(){ return counter; ...
Jestem programista .Net. I jestem programista wygodnym. Lubie poswiecac czas na szukanie narzedzi, które w przyszlosci pozwola mi oszczedzic czas. No i najwazniejszym pytaniem jest oczywiscie – czy to jest oplacalne? Czy wiecej czasu zaoszczedze uzywajac tych narzedzi/projektów/przydatnych kodów zródlowych, niz strace na ich wyszukiwanie? Do tego trzeba tez doliczyc obciazenie spowodowane przystosowaniem do nowych technologii i poswiecenie jednego projektu na pastwe losu (bo zawsze moze sie nie udac ...
A co-worker posed an interesting LINQ problem to me tonight so I figured I’d share. They had a collection of items and wanted an algorithm that would create a “collection of collections” where the first three items would be grouped together, second three items, on so on. For example, given a sequence like this: { “a”, “b”, “c”, “d”, “e”, “f”, “g”, “h” }, it would create a structure that contained 3 groups – the first element would be { “a”, “b”, “c” }, the second would be { “d”, “e”, “f” } and the ...
In this Issue: Michael Washington, Faisal, Jose Fajardo, IRhetoric, Brad Abrams(2), and Jonathan van de Veen. Shoutouts: Inspired by Tim Heuer, Jobi Joy has a demo of him using his HP Touch machine with an application he provides: Silverlight 3 Multi-Touch with Windows 7 and HP Touch Smart René Schulte has a follow-up to his very cool WriteableBitmap Performance program where he adds in 2 more tests: Silverlight 3 WriteableBitmap Performance Follow-Up Jonathan van de Veen has a patch up for his CodeEmbed4Web ...
As predicted, I came around to using some radio buttons. As you might guess by now, I didn't like the HTML or the implementation in the current MVC release. As you may expect, I wrote my own :-) The implementation is fairly simple and straightforward. It extends System.Web.MVC.ViewPage, takes a list of objects, allows for selection of one of the radio buttons, supports orientation and supports selection of both the value the radio button submits and the display string for that item independently. ...
Last weekend (August 1st and 2nd 2009) I went into London to attend the Alt.NET UK Conference or more specifically two separate but related days. This was my first ever Alt.NET conference and I absolutely loved it. It was exciting to be around so many enthusiastic and smart individuals discussing software development with an open mind and a desire to help those around them. No elitism, no stuffiness, just developers doing what they do best – talking about (and doing) development. It reminded me of ...
The need As certain as the sun rising tomorrow, there will come the point where you will want to display a list or grid with paging. While many solutions exist, and many component developers are coming in with robust solutions, a simple and satisfactory solution can be created fairly easily. Implementation Why create a pager from scratch? Several reasons: 1) You want to control the pager completely – display, style and all. 2) You don't like the idea of JavaScript paging, which will load your hundreds ...
In my last blog I talked about the new site around SharePoint 2010 and the sneak peak videos. I got a chace to watch them and here are my notes: SharePoint 2010 Feature Highlights: New User Interface including new Ribbon Web Edit Silverlight Web Part Rich Theming Browser support for Safari, Firefox and IE Visio Services SharePoint Designer enhancements Business Connectivity Services (BDC evolution) SharePoint Workspaces (formerly Groove) or offline libraries Richer Media Support SharePoint 2010 Admin ...
My general rule of thumb (which I actually read on some other site or blog, or maybe in a book or on the msdn?) is that if you plan on using a control once or twice, use a web user control. If, however, you want to use it all over your program, you should invest the time to make it a server control. They are much easier to use in the program (in the long-term), since they allow you to drag and drop them from the toolbox and you can pass them between programs easier as a DLL instead of a .ascx file. ...