LINQ in Action roller

August 2006 - Posts

  • LINQ to Text Files

    Lazy evaluation is an important technique in functional programming. There is a entertaining article on functional programming here . I was thinking about lazy evaluation the other day, and the issues of processing huge text files using streaming techniques, and I realized that LINQ could do really cool things if I implemented an extension method for StreamReader that iterated over the lines of a text file. Because of the lazy evaluation, provided you construct only certain queries, this technique Read More...
  • VB9 Prepares for World Domination

    With people like Erik Meijer and Brian Beckman leading the charge, Visual Basic is on a course for World Dominiation . Checkout the channel 9 video with Brian to learn more about how they're aiming to make VB the language of choice among the developers of the world. As I stated before there are a lot of very nice features making their way into VB that could begin to grab my attention away from C#. Then again maybe not Read More...
  • Generating an RSS Feed from the Event Log using Linq to XML

    Jim Wooley put together a nice "cool code" sample for the Jacksonville Code Camp. Obviously anything that uses Linq gets my vote. He took third place for his Linq to XML code that generates an RSS feed from the Event Log using VB9's XML Literals . Download tags: linq , linqtoxml , xlinq Read More...
  • Called on the carpet for not solving ALL Scoble's problems

    M. David Peterson calls me on the carpet for not really solving ALL of Scoble’s problems and for not using a fancy algorithm to boot. I was waiting for someone to expose me and it appears it’s happened. Anywho, he has a nice post on how he solved Scoble’s problem using XSLT . He ends up with 29 lines of XML (data + transform) compared to my 48 lines of Linq code . Of course I like my version much more since it uses Linq but his post does point out an important point, while Linq and Linq to XML do Read More...
  • Solving all Scoble's problems with Linq to XML

    Although Scoble already received a lot of answers on how he can get get what he wants out of his Excel file containing all the URL's from the http://weblogs.com/changes.xml file I couldn't help but fire up VS and solve his problem using Linq to XML. I'm sure Scoble will send me a big fat check for solving his problem with one of the cooler technologies that will coming out of his former employer. Of course I didn't give him just the URL's that he asked for either so maybe I shouldn't hold my breath. Read More...
  • LINQ to Entities vs. LINQ to SQL

    Kevin Hoffman has a nice post outlining the differences between LINQ to Entities and LINQ to SQL . As I've stated before I think LINQ to SQL should go by the wayside for LINQ to Entities. If you're going to create a conceptual model that directly maps to your relational model you can still use LINQ to Entities. Why lock yourself into a direct mapping when you can instead have the flexibility of a conceptual model which can change independently of your relational model? LINQ to Entities is where it's Read More...
  • Refresh data modified by an other source

    Hi, When values are updated into my database from an other application, is there a way to update my DatabaseContext instance with the new content of my database? For now, I am creating a new DatabaseContext each time, but it is really time consuming... At least is there a way to know if my DatabaseContext instance is not synchronized anymore with my data ? Read More...
  • XML Standardization Organizations and Processes

    There's been a lot of unhappiness about the W3C floating around recently, well-summarized by Dare Obasanjo . Most of us involved with XML at Microsoft share a good bit of the general frustration, if not the specific complaints, expressed in these posts. I don't think there's a strong consensus across the various people and teams on what the problems and solutions really are, but I think many would agree with a few points: The process really isn't stacked in favor of anybody, including the " multinationals Read More...
  • Creating an RSS Feed using LINQ to XML (XLinq)

    To help get more familiar with the new XML Programming API that is hidden away inside of LINQ to XML I recently set on a journey to update the code that creates my RSS feed to use LINQ to XML. In order to complete my journey I needed to get familiar with how to use functional construction to build XML from a set of in memory objects. Before diving into the LINQ to XML code let's first take a peak at the old code which was building the XML using an XmlWriter. 1 StringWriter sw = new StringWriter (); Read More...
  • August CTP of ADO vNext

    Pablo Castro just annouced the August CTP for Ado vNext. You can read about it at http://blogs.msdn.com/adonet/archive/2006/08/15/701479.aspx or download it at http://www.microsoft.com/downloads/details.aspx?FamilyId=B68F6F53-EC87-4122-B1C8-EE24A043BF72&displaylang=en . The initial documents do indicate that LINQ to Entities is supported in the CTP. Give it a try and let the teams know what you think. Jim Wooley http://devauthority.com/blogs/jwooley Read More...
  • LINQ and Atlas

    Ok so what I am trying to do is have a form with a textbox for a search dialog. On keypress I want to query top 25 records and display them in a gridview, so as you type it refines the search etc. So I have hooked up all the atlas javascript methods etc but I am not sure if I am able to do this or not. Basically my webservice code looks like (generated with BLINQ): return from dom in db.Domains select dom; So this should return all my records (fine for now in testing) and my javascript receiving Read More...
  • New programmer type: Mortenstein

    When talking about programmer types, there are three personas: Mort, Elvis, and Einstein . Through deep research and extensive analysis, I have determined that there is a fourth type: Mortenstein. This programmer is an Einstein who is oportunistic. He or she will grab any tool available to do a job quickly - it doesn't matter if the tool is complicated or not - so long as it gets the job done quickly. My boss suggested that there are a lot of Mortensteins in the Perl community! Read More...
  • Asynchronous LINQ???

    Given WCF's decent support for asynchronous server-side methods (going by the docs), is it likely that LINQ to SQL will support asynchronous query execution in the future? Perhaps a BeginToSequence method, eg: IQueryable customers = dataContext.Customers.Where (c => c.Name == "Jones"); IAsyncResult result = customers.BeginToSequence (Callback, null); It might be worth including such methods because for the end-programmer to add them could involve re-writing DLINQ. An alternative would be modifying Read More...
  • LINQ vs. 2.0 SQL Server Projects vs. SQL Scripts

    Good Day, At present, most of my orgs DB scripting is kept on the SQL server in the form of stored procs. This has proved a management and versioning pain. Hence, SQL server projects may be a way to move the scripts out of the SQL server. A few questions though... What is the performance difference between running SQL server project queries and running SQL queries via traditional ADO.net methods? What is the performance difference between the emerging LINQ technology and SQL Server Project queries? Read More...
  • Typed XML programmer -- What are your pains today?

    This post continues the “Typed XML programmer” series of blog posts. This time, let’s ponder about ‘ the 1 st generation of typed XML programming ’. What are the imperfections of the 1 st generation ? (Thanks for your feedback so far. In particular, I loved Bill's thoughts on ‘ XML as a true first-class citizen ’ and the behavior that is to be associated with such ‘XML in objects’. Bill, do not spoil my story any further; I am getting there!) Definitions of typed XML programming Let me recall my Read More...
  • Additional Notes on Parsing WordML with XLinq

    Here are a few more notes on parsing WordML with XLinq. First, in the blog entry, I didn't call out that the Word doc CodeInDoc.xml is attached to the blog entry. It is. Second, Steve Eichert has some good additional points to make about code that reads WordML. Third, when you look at the WordML, those pesky namespace prefixes make it somewhat difficult to see the structure of the XML. The WordML fragment that I showed in the previous blog is: <w:p> <w:pPr> <w:pStyle w:val="Code" /> Read More...
  • LINQ to XML in action

    We're starting to see some real applications that demonstrate how easy it is to use LINQ to XML (I'm just gonna keep abbreviating it "XLinq") to get real XML work done without too much sweat or tears. One from a team member is Eric White's Parsing WordML using XLinq Recently, I had a problem where there wasn't a code testing harness that would do exactly what I wanted. I want to grab my code snippet directly from my word document, compile it, run it, and validate the output. In more technical terms, Read More...
  • Parsing WordML using XLinq

    Recently, I had a problem where there wasn't a code testing harness that would do exactly what I wanted. I want to grab my code snippet directly from my word document, compile it, run it, and validate the output. In more technical terms, I want to parse some WordML to grab text formatted with a given style. Further, I want to put a comment on the first line of the formatted text, and be able to grab the comment. The comment will contain the metadata that tells how to compile and run the code. My Read More...

Featured Item

This Blog

Sponsoring

Syndication