A step-by-step introduction to the system views containing dependency information in SQL Server:
A topic that was on my imaginary “C# Wishlist” until I found out
1) why it’s a bad idea and
2) how to implement it with techniques C# already provides.
So the series should really be called “Virtual Static Interface Methods in C# – and why you do not need them” 😉
Linq To SQL does not natively support bulk operations (batch operations).
A new batch operation should operate on the existing Linq To SQL infrastructure, namely
- the L2S DataContext
- the class declarations of the data model generated by the .dbml designer
This series sketches an implementation of batch operations using Linq To SQL:
Generating T-SQL from Linq queries
Batch Insert with Column Mapping
How to create User Control Libraries in Visual Studio and why this is a bad idea.
migrating existing code
an issue and a fix
another issue fixed
The standard way to update a record using Linq to SQL is to load a record from the database, assign the new column values, and submit the changes.
This method is undesirable if your table contains long text or binary columns, since they are loaded into the Linq to SQL object without being used.
Starting with a table containing nvarchar(max) and varbinary(max) columns
CREATE TABLE [dbo].[FooMax]( [OID] [int] IDENTITY(1,1) NOT NULL, [ID] [nvarchar](50) NOT NULL, [SomeText] [nvarchar](max) NULL, [SomeBinary] [varbinary](max) NULL, CONSTRAINT [PK_FooMax] PRIMARY KEY CLUSTERED ([OID] ASC) )
I listed a couple of methods to reduce database access to the columns actually required in the UPDATE process:
The dbml mappings for these solutions