-
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...
-
Julie's got a great post about when stored procedures execute when using LINQ to Entities . It made me think about LINQ to SQL where if I've got something like; using (NorthwindDataContext ctx = new NorthwindDataContext()) { var query = ctx.GetCustomersByCountry( "UK" ); // SQL Happens Here! foreach...
-
Matt Warren has an "interesting" post on how you could hack your way to a mocked implementation of LINQ to SQL - if I had a pound for every time someone's asked me how to do this then I'd have at least 3 pounds :-) Seriously though, there is interest in doing this kind of thing and it's a good starting...
-
I was talking to Ian and another chap at the UK Launch yesterday about LINQ to SQL and my use of the DataContext in some demo code where I always tend to write something like; using (DataContext ctx = new DataContext()) { } and whether I actually needed to do that dispose or not? Now...I was pretty confident...
-
I had a discussion at DevWeek about when SqlDataReader.Read () gets called for resultsets coming back from stored procedures accessed with LINQ to SQL. I've got this stored proc; create procedure dbo.GetCustomersByCountry @country nvarchar( max ) as set nocount on select * from dbo.customers where country...
-
I have a mail from Tim on the EF team that I've had for a little while. I'd asked a question about mapping and he'd given me an answer saying something like "Oh, you could always do X, Y, Z" and I'd left this mail in my inbox for a while because I've been distracted and also because I didn't really understand...
-
Just a quick plug :-) I'm speaking at the "SQLBits" conference in Birmingham on the 1st March. The agenda is up here . The agenda is built by voting from prospective attendees and I found it interesting in that I submitted a few sessions that looked something like; "Entity Framework Tour" "LINQ to SQL...
-
Mats has a post over here about concurrency in LINQ to SQL with a long write-up about issues that he sees in using the framework. I've not read all of it yet because the very first point that he raises sent me off on a bit of a tangent (which does not necessarily provide an answer to any/all of his post...
-
Entity Framework Beta 3 is available along with a new Entity Designer (CTP 2) is out as well. These are for Visual Studio 2008 RTM and .NET Framework V3.5 RTM. Find blog posts up here; ADO.NET Entity Framework Beta 3 Released! Entity Designer CTP2 with the full details but I like the sound of; Simpler...
-
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...
-
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...