Tag | LINQ Posts

I have been pretty excited about LINQ, because it seems to do all of the optimization for me for free (kinda like T-SQL). Yow Han-Lee asks in his blog, Brainteaser #11, Given any two large List, what is the quickest way to find the mutual intersection of the two? Now take into consideration memory constraints? Well, the answer that only takes a minute or two for me is the following... Comments welcome! Jonathan Starr using System; using System.Collections.Generic; using System.Linq; using System.Text; ...
Jeff Prosise wrote a very interesting article in which he demonstrated how to rewrite URL using RewritePath method. In this post I will be using the same method to rewrite the article URLS. Good URL names can result in more traffic to the website since the URL's are index by the search engines. Let's say your website has the following Url: http://www.mywebsite.com/Ar... Although it works and performs the required option but it is very hard for the search engines to index the page ...
Dynamic Website Project allows you to create customizable support pages. This can be really helpful if part of your job is to create boring support pages. Recently, I had to create few support pages so I thought why not try the Dynamic Website Project. So, I added the LINQ to SQL as the data source and used one of the databases to create the support pages. In our application whenever a row in the database is updated we update the DateModified field. This can easily be performed inside the GridView_RowUpdating ...
This week I gave another .NET 3.x session for the syntrawest ITClub developers in Kortrijk. 19 People from West Vlaanderen where interested in Workflow Foundation and liked my presentation. As promised to them : you can download the code of the demos here. BTW : the agenda for my next sessions : 26/02 : VS2008, ADO.NET in .NET 3.5,LINQ 22/04 : Patterns & Practices, Applicaton Blocks and Software Factories 27/05 : Rich Internet Applications with Silverlight Want to attend these events ? Drop me ...
Okay so we've had an onslaught of new things hit in the Microsoft stack lately. I am curious how many folks are using WCF, WPF, WF (workflow), Silverlight, LINQ, etc. And for what types of problems you are trying to solve. It would also be nice to know if you are using the P&P Guidance Packages and Ent Libs. Oh and which Visual Studio version are you mainly working with these days? If you are not using this stuff yet why? Did you pitch it to your boss and they said no for some reason? Did they ...
Last week I was present at the MCT Summit in Berlin. Had fun, saw great presentations. A big applaus was given to Marcel De Vries for his LINQ presentation. Which was deserved, this was the best LINQ presentation I had ever seen. Altough the summit was more focused on ITPro and SQL stuff I had a good time. I was introduced by MCT collegeaus to the world of virtualization and Microsoft Hyper-V. Some 400 MCT’s from the EMEA region where there. About 10 belgians quickly joined together and started thinking ...
Update: Added new Hanselminutes show on F# and other links With the new year comes new challenges. Recently I've been looking to take my background in statistics and get back into graduate school. With those days brought the days of functional programming, pattern matching and all sorts of things. So, with that, I began to look at F#. Why F#? No, it's not because it's shiny and new and everyone's talking about it. To a point, it made me more aware, but I won't just hop on the next best thing without ...
Scott Guthrie[MSFT] announced the availability of .NET fx 3.5 library source code as promised. (Setup and how to use) Quote from the announcement: Specifically, you can now browse and debug the source code for the following .NET Framework libraries: .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel, System.Diagnostics, System.Drawing, System.Globalization, System.IO, System.Net, System.Reflection, System.Runtime, System.Security, System.Text, System.Threading, ...
I felt the need to vent a little bit of frustration today as I spent an entire weekend trying my best to figure out how to get LINQ to SQL to support what I consider to be a fairly standard database design concept - many to many relationships. In my case I have a table of Permissions and a table of Accounts. Rather than storing a list of permissions in my Accounts table I simply wanted to store both Accounts and Permissions separately and then link them together with a linking table. I don't think ...
Scott Hanselman beat me to the punch, but come Feb 14th, our latest and greatest edition of the Professional ASP.NET book is coming out. The book has a ton of new content and was exciting to put together - but man, did it take some serious time to do (especially when all three of us have real jobs, kids, newborns, animals, etc to deal with). The book is big ... really BIG - 1728 pages, so it can serve many other useful purposes after you are done reading it! :) The book description from the WROX.com ...
For those who missed it, our DC ALT.NET group will meet on January 15th at 7PM. I'm hoping for a great turnout of passionate developers in the DC Metro area. Hope you can make it. Also, don't forget to join the list as we discuss more issues and our next meeting stuff. The meeting this month will bring ALT.NET to CMAP. Are you a developer who always keeps an eye out for a better way? Do you look outside the mainstream to adopt the best practices of any development community, including Open Source, ...
GridView! YES! (...1 hour passes...) Dah! GridView! *Fist Shaking* Coming from a Java background I have to say that the standard toolset that Microsoft provides in .NET 3.5 is impressive by any standard. Perhaps the fact that it is standard is what makes it so powerful.... That being said I want to just give a quick rundown illustrating the rollercoaster ride that was my first run in with GridView from .NET 2.0. I first wanted to just populate a table, after a quick googling I landed here: http://msdn.microsoft.com/m... ...
I've been reading lately about what people are interested in with the next version of C#. It's amazing to think how far the language has come from the early days. Many of the newer features of the language with 3.0 by far have made it a better language. So, what did we get with the latest C# 3.0? Object Initializers Automatic Properties Anonymous Types Extension Methods Lambda Expressions LINQ Collection Initializers By far, I agree with most of Jeremy Miller's sentiments regarding C# vNext, including: ...
Lately, I've been evaluation my use of extension methods. Extension methods have a good use, but that can quickly turn to overuse and confusion. The Evil When I start seeing these methods, I really start to wonder if it's really necessary. In fact, I run away screaming with my hands flailing above my head. internal static class ExtensionMethods { public string IsValidEmailAddress(this string email) { ... } public DateTime IsBefore(this DateTime date) { ... } } For readability sake, it's very tempting ...
While working on an application I faced the following error when trying to submit changes to the database using DLINQ: exception = "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." So, from the exception it seems like my date is initialized to a wrong state. By, the way I put the default value for my date to be GETDATE() in the database and while inserting I was not setting the date property namely "DateCreated" and "DateModified". So, in order for the submit ...
Anonymous types are excellent addition to .NET “Orcas” release. These are a convenient language feature that allows developers to write code without bothering about what particular type of object they are dealing with. Anonymous types are declared by var keyword which you most of the times will see in different application of LINQ. It's true it great use with LINQ, but it's not a LINQ feature at all - it's a new language feature. A very simple use of Anonymous types is (starting with a keyword var): ...
The following works fine in LINQ, because an array implements IEnumerable <T>. string[] tokenArray = new string[2] { "Hello", "World" }; var tokens = from token in tokenList select token; foreach (var item in tokens) Console.WriteLine(item); But, the collections which do not implement IEnumerable<T> or IQueryable, can not be iterated in LINQ in the same way. To achieve the same, make use of a simple casting trick such as: ArrayList tokenList = new ArrayList(); tokenList.Add("Hello"); ...
I have blogged about ASP.NET "Futures" and Dynamic Data Controls in my earlier post. You could create a Data Driven Website very quickly using the "Dynamic Data Website" template that shipped with the ASP.NET "Futures" July 2007 CTP. However, the ASP.NET Extensions 3.5 shipped in December 2007 bundles a bunch of Dynamic Data Controls that are more powerful and offer more extensibility than the ones shipped with the ASP.NET "Futures" July 2007 CTP. Let me clarify a few things here on the releases:- ...
Hi Folks Decided in 2008 to read a lot more - have a fair bit of spare time and not putting it to much use. I'ts been a while since I read some of code complete 2 and I'm looking for some inspiration - I read plenty of blogs but really want a good book and open to suggestions on lots of differnet topics. I am mainly a Microsft Net developer and I've been looking at Silverlight and Linq mainly but would welcome some suggestions (and reasons for the suggestions) o some good books. Cheers G ...
I have been working on the domain builder but still reading articles and blogs. While I still love the idea and the concepts, the MVC presentations are really slick. I think that I am going to change direction just slightly and focus on the MVC pattern from Microsoft. I still plan on having CSLA and NHibernate talking together. I just read another article on Ayende's site about having NHibernate using LINQ. I will explore this further as well, but right now my focus is getting the MVC pattern talking ...
I got this book as a Christmas present and quickly read through it cover to cover. The primary focus of the book is to provide an introduction to LINQ (language integrated query) that is available in the Microsoft .NET Framework 3.5. In this end the book does a good job. Just don't look for anything comprehensive. The book starts out talking about what LINQ is and follows that up with a few chapters that talk about the new language features in C# and VB that make LINQ possible. I found the information ...
Both the .NET 3.0 and .NET 3.5 are built on top of .NET 2.0. .NET 3.0 adds four frameworks namely Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), Windows Presentation Foundation (WPF) and Card Space to .NET 2.0 and Microsoft named the resulting framework as .NET 3.0 (a marketing tactic). Similarly .NET 3.5 adds Language Integrated Query (LINQ), Representational State Transfer (REST) and AJAX functionality to .NET 3.0 and named the resulting framework as .NET 3.5. I will ...
I've been seeing several people blogging about the free Microsoft Press E-Book offer. All you need to do is register and you get access to 3 e-books from Microsoft Press that you can download in PDF format. If you pay close attention to the details for each book, you will notice that these aren't full copies of the books. The only one that appears to be a full copy, based on the listed chapters and the actual table of contents in the PDF, is Introducing Microsoft LINQ. The other two e-books only ...
Few hours ago, Michael Schwarz, the creator of AJAX.NET Professional (A.KA. AJAXPro), the most successful AJAX framework for ASP.NET after Microsoft's ASP.NET AJAX Framework (A.K.A., ATLAS) has stated that he'll no longer be working on the project. Furthermore, he even recommended users to move to Microsoft's AJAX Framework instead!! The reasons Michael mentioned why he will stop the project used by 13.3% of ASP.NET developers doing AJAX work include the fact that ASP.NET AJAX is part of ASP.NET ...
Soren in his post expresses his desire for finding the SQL Query Analyzer equivalent of LINQ. He states: “ If you haven't picked up on it yet I can tell you that I' very excited about LINQ at this point. Now all I need is for someone to create Query Analyser for LINQ for me and I'm good to good. What's even more interesting about such a tool is the fact that you would be able to target not just SQL but all the supported data store, although the queries wouldn't be interchangeable ” Turns out, Soren ...
I frequently blog about Code Styles & Standards. One of the references that I use a lot when trying to justify a change to a companies existing standard (or simply putting a standard in place) is the Framework Design Guidelines by Krzysztof Cwalina and Brad Abrams. Both of them today officially announced that they are working on the Second Edition, which will cover the .NET Framework v3.0 and v3.5 releases, including LINQ and the other language advances. They are both looking for feedback on ...
I know it's been awhile since I last posted, but let's blame it on the holidays. Anyway, what I wanted to post today are screen shots of the latest working code. First I'll start with what the domain builder interface looks like. It leverages the DSL (Domain Specific Language) interface as part of the Visual Studio SDK package. Click on the picture below for a closer look. The model represented above has all entities sharing common attributes and thus inherit from the BaseEntity class. You will also ...
We are announcing our second meeting of DC ALT.NET on January 15th at 7PM. The meeting this month will bring ALT.NET to CMAP. Are you a developer who always keeps an eye out for a better way? Do you look outside the mainstream to adopt the best practices of any development community, including Open Source, Agile, Java, and Ruby communities? Are you always looking for more elegant, more simple, more maintainable solutions? If so, then you might be an ALT.NET practitioner! This group follows the Open ...
The year has come and gone. We've just completed the celebration of Christmas in our new home with our new daughter -- she's almost one now! Work is still going well. I'm working on the replacement to VisiWatch again after a long departure to work on some internal workflow fixes and changes. I've also made some good headway into eliminating some of the legacy Access databases and I've set SQL Reporting Services although right now it's not doing anything in production mode. We've upgraded some things ...
I did this from home early this morning (probably at the same time that I messed up Daniel Vaughan's name in my Silverlight Cream post). By the time I got everything fired up here, the blog post I used had rolled off my blog roll, but I found it again here from Tom Mertens. The implication is that you can get all 3 eBooks, but what I actually got was selected chapters of the ASP.NET Ajax book and the Silverlight book, but was able to download the LINQ book complete, and I figure that's great! If ...
What will the new year bring to us? Fact is that we already have the Visual Studio release of 2008 including .Net 3.5. This big improved development environment is a guarantee that 2008 will bring a lot of happy coding experiencing some new language improvements like Linq and improved WPF. Be carefully if you intend to do some fireworks, sow you don't need to code with less fingers next year. I wish all the best and a good health for all of you in 2008. Till next year ...
Recently I've done a series of posts all related to using Linq in a tiered application: Linq Table Attach() Linq Table Attach() based on timestamp or row version Handling Attach() with child entity objects Exploring DataContext in more depth The various posts (which have been influenced by this MSDN article) have focused on a DataContext that looks like the diagram below. The Contact class generated has a child collection property of Addresses which is of type EntitySet<Address>. This distinction ...
In a previous post here, I discussed implementation of Attaching Linq entities to a DataContext. In that post, I showed an implementation of utilizing a Detach() method that I originally based on this post here. The implementation boils down to the need to reset EntityRef<> references back to their default - otherwise, it will try to attach the parent objects (which is often not the goal of your code as this is often just reference data). Consider the DataContext below: The fundamental problem ...
I must admit that ASP.NET is a bit outside my realm; I did Win32 and Mobile development in C# .NET for nearly 4 years before taking a position as a Web App Developer. Therefore, I am more code-minded than web-minded, if that makes sense. I have the programming ability to do a lot of things, but making things aesthetically pleasing is where I lack most. Luckily, for me and my company, we have web designers who get paid to make things look pretty. In light of this, I’ve basically abandoned my quest ...
In case you haven't heard, Microsoft is providing a free Visual Studio 2008 and Framework 3.5 training kit at their download center here Overview The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application ...
This exception using the Linq Attach() method is somewhat perplexing at first: System.NotSupportedException: An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported. This blog post here *sort of* pointed me in the right direction. But I found the *WHY* confusing and I found the example confusing. The following is my implementation of the suggested solution from the previous post. First, consider the following ...
I just signed up the Philly.net Code camp. Did you? There are only 400 seats available! Here are the details: Our first installment of the 2008 Code Camp series will be held at the DeVry University campus in Fort Washington, PA on Saturday, January 12 from 8:00-5:30. Please register on our web site.-->Detailed directions are on the DeVry web site. Lots of code, just say no to slides! 9 hours 48 sessions (8:00, 9:30, 11:00, 1:00, 2:30, 4:00) 8 tracks 400 seats with tables (laptops welcome) Free breakfast, ...
I promised some people to post the slidedecks of my last 2 seminars for the syntrawest ITClub. 1. Agile Development met Visual Studio Team System 2. Windows Communication Foundation See you on the next seminars : 22/01 Workflow Foundation 26/02 LINQ + ADO.NET Entity framework 22/04 Rich Internet Applications with SilverLight ...
I seem to be working more and more my lappy these days...still always on the my PC at the office but when at home the laptop has taken over from my machine of choice...strange really because I love having two monitors and find it a fantastic way to work but I guess the freedom a laptop has to offer wins the day. Anyway, I digress...seeing I was working on it more and more I decided to get myself a Christmas present in the guise of a specialist notebook mouse, I looked at several offerings from Microsoft ...
Yes I'm going to discuss this again, so if you know me personally, or have heard me talk about it before, just click the "Delete" button :) Somewhere around the fall of 2003 I was working for what was essentially a failed dot com. The product was great, but nobody could figure out how to get US banks to buy into it. Maybe someday, but not then, and not even now for the unfortunate folks that are still trying to make it work. I was working from home, elbow-deep in Win32, MFC, platform SDK in C++, ...
The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management. http://www.microsoft.com/ ...
If you are doing any work with any of the following technologies: LINQ, .NET 3.5 (C# 3.0, VB 9) WCF WPF WF CardSpace Silverlight ASP.NET Ajax .NET Compact Framework 3.5 VSTO 3.5 Visual Studio Team System and Team Foundation Server You should download the free Visual Studio 2008 Rhythm Training Kit (125MB). The training kit contains 5-days of technical content including 20 hands-on labs, 28 presentations, and 20 scripted demos ...
Jeff Barnes has made his extended talk (think "deep dive") on the following topics available: NET 3.5, Visual Studio Enhancements Lifecycle tools ALM, C#, VB9, Interop, LINQ ParallelFX PLINQ Services (WCF, WF, CardSpace) Windows Applications Web Applications Office Applications Mobile Applications Synch Services for ADO.NET Orcas_For_Architects_Jbarnes - Part_1.zip - 3.6 MB Orcas_For_Architects_Jbarnes - Part_2.zip - 4.8 MB Orcas_For_Architects_Jbarnes - Part_3_Links And Resources.zip 188 KB ...
Today is the primary day of Muslim's ADHA (Sacrifice) feast. I'm enjoying it with family activities in my grandmother's house and few hours later my uncle's house. Thanks God both have wireless Internet connectivity. This how I could still check my Google Reader items (see shared items), while showing my profile pictures to my uncle's little daughter and other kids from the family! Then I noticed that the feast has a great gift, coming from Microsoft this time. I found that Microsoft has opened 3 ...
This offer is from Microsoft. Get it at http://www.microsoft.com/le... The free e-book includes content from three recent publications from Microsoft Press: • Introducing Microsoft LINQ by Paolo Pialorsi and Marco Russo (ISBN: 9780735623910) This practical guide covers Language Integrated Query (LINQ) syntax fundamentals, LINQ to ADO.NET, and LINQ to XML. The e-book includes the entire contents of this printed book! • Introducing Microsoft ASP.NET AJAX by Dino Esposito ...
About me: I am a 35 year old .NET software engineer. I have 15 years experience in the Industry. Originally from Sydney, Australia, i now live in Ness Zionna Valley, Israel. I have a Masters degree in Bioinformatics, and plan to do a pHD in Mathematics / Algorithms / Artificial Intelligence. I currently work for a training and outsourcing company called Sela. I have 2 kids, with a 3rd on the way. I maintain my technological edge by getting up really early in the morning and taking public transport ...
As noted in some of my previous posts, there is a lot of excitement around the ASP.NET 3.5 extensions including MVC, Dynamic Data, Silverlight and so on. I have a few samples I'll be posting within the week using ASP.NET MVC with such things as Spring.NET, Castle Windsor, Object Builder and so on. In the mean time, I'm still working on the Spec# posts and some SharePoint Model View Presenter I hope to get out soon. Anyhow, there are some great links out there for doing cool stuff with ASP.NET MVC: ...
The ability to use live Linq queries right in your UI makes for great demo's, but it doesn't bear a striking resemblance to a real-world, professional application which uses tiers. In traditional n-tier applications, you want to have a strong "separation of concerns" and encapsulate your business layer, your data layer, and your UI layer distinctly. One of the nice things about Linq is that the flexibility is huge. If you want to do live queries in your UI, fine. If you want to encapsulate Linq queries ...
A timely article appeared in the NY Times today (link) regarding Parallel computing as the next key factor in keeping up with the ever demanding needs of getting things done faster. As the article points out, the single CPU processor can't address our needs for faster computational capability without literally burning up or melting. I've seen this personally with Vista and the stressing of the GPU on some older notebooks. So, what's the solution, well, it's been around for decades, it's just now ...
By now you've attended an InstallFest and picked up a free copy of Visual Studio 2008 Pro, or perhaps you've just downloaded trial edition. Either way, it's time to get up to speed using the free Visual Studio 2008 and .NET Framework 3.5 Training Kit. It covers many of the new features in LINQ, C# 3.0, AJAX, WCF, WPF, and Silverlight ...