Archive for the ‘LINQ’ Category

Inserting into a Table with LINQ to SQL

While creating a little project, I wanted to know how to insert an object into a table using LINQ to SQL. Using Intellisense it wasn’t obvious at all. Scott Guthrie wrote a post on how do it. Unfortunately, the method name has changed since he did it, so you need to call InsertOnSubmit on the [...]

More »

Using LINQ To SQL’s DataContext in a Multi-Tier Application

I’m still reading the excellent C# 3.0 in a Nutshell: A Desktop Quick Reference (In a Nutshell (O’Reilly)), by Ben and Joseph Albahari. It answers a popular question: how do I use a DataContext object in LINQ within a multi-tier application? According to the authors, you cannot use the DataContext at an application or static [...]

More »