-
The sessions from the client development day at TechDays UK are available. I’ve brought them together here but you can also visit the TechDays site to grab slide-decks and other resources; “The Client Decade” Marc Holmes , Microsoft “Visual Studio 2010 and WPF 4.0” Ian Griffiths , Interact Software ...
-
Following on from that previous post about the WPF DataGrid I thought it might be interesting to try and move towards more of a master/details view with a separate grid displaying the orders for each customer. I modified the UI a little bit; < Window x:Class ="BlogPost.Window1" xmlns ="http://schemas...
-
Mike was chatting to me about how you'd take something like this ( against LINQ to SQL and the Northwind database ); using (NorthwindDataContext ctx = new NorthwindDataContext() { Log = Console.Out }) { string [] values = { "A" , "B" , "C" }; var query = from c in ctx.Customers select c; foreach ( string...
-
I came across a bit of a glitch in using timestamps for checking concurrency violations in LINQ to SQL and thought I'd share. Say I've got a table like; create table Person ( id int identity primary key , firstName nvarchar(30), lastName nvarchar(30), timestamp ) so, we have a simple table that has a...
-
I'm doing a talk down at ACCU this evening on VS 2008 and, specifically, as it's a short talk focusing on what I think is the biggest single thing in VS 2008 which is what changes around the languages and LINQ. The slides for the talk are here in PPTX , PPT and PDF formats.
-
Thanks to the people who came along to my talk on Entity Framework at VBUG in Bristol yesterday. I promised that I'd make the slides available and they can be found here for download in PPTX format and PDF format . This was more or less the same talk as I delivered at Southampton the week before so these...
-
A new version of the LINQ to XSD preview that works with Visual Studio 2008. Get the details from here . If you're not so sure on what LINQ to XSD is all about it's essentially for the people who see some LINQ to XML code and say; "But how come the LINQ to XML code has all those ugly strings and casts...
-
I've encountered this strange piece of logic a few times now; Feedback: I really like LINQ to [SQL/Entities] but it generates dynamic SQL and I don't like dynamic SQL. Response: Ok, why not use stored procedures from LINQ to [SQL/Entities] and then you won't have dynamic SQL? Feedback: But if I use stored...
-
I saw a question recently about how to asynchronously execute a LINQ to SQL query. Unless you want to go down the "fake async" route of pushing a query out onto the ThreadPool, you can (AFAIK) do real async work by using the GetCommand() method of the DataContext and then doing the work yourself. So...
-
I was thinking about DataContext.Translate today and what it means for anonymous types. Let's say you've got something like; using (NorthwindDataContext ctx = new NorthwindDataContext()) { ctx.Connection.Open(); using (DbCommand com = ctx.Connection.CreateCommand()) { com.CommandText = "select c.CustomerId...
-
Something I've been pondering. Living over in System.Xml.XPath is an extension method to XNode (from LINQ to XML) called CreateNavigator . So, given something like an XElement ; XElement x = new XElement( "foo" ); I can go ahead and get an XPathNavigator from it; XElement x = new XElement( "foo" ); XPathNavigator...
-
Ok, so this whole post probably falls into the category of "nasty hack" but it was something that I was playing with so I thought I'd share. I wrote a little bit here previously about working with LINQ to SQL in a disconnected sense and wrote about how, if you wanted to manage concurrency in a reasonable...
-
I did a bit of a poor talk on LINQ today. One of the reasons that it didn't go so well was that my most basic of LINQ to SQL demos wasn't working. Now, I've demo'd LINQ to SQL in "intro" form (and quite a bit beyond) maybe 20 times and it always works fine. Not today. Today was the day when my most basic...
-
I've got this XML file; it's an export of the Northwind Employees table. I load this up with LINQ to XML and then I want to databind it into a Windows Forms ListBox. In the ListBox, I want to display a concatenation of the firstName and lastName but I also want to be able to get back to the XElement...
-
LINQ to XML and the XML API that underpins it contained in the System.Xml.Linq namespace is essentially a DOM-like API. This means that documents are loaded into memory to form a "tree" representation and that act of loading into memory means that the bigger the document you have, the more memory you...