CHAPTER 30

image

Linq to SQL

An object-oriented language such as C# and a SQL relational database have different views of the world. This is sometimes known as an impedance mismatch. The concepts of an object in C# and a row in a database seem very analogous, and there have been many attempts to unify them, with Linq to SQL being one of the more successful ones.

Linq to SQL is a very big topic, and covering it thoroughly requires a full book.1 This chapter is an introduction to using Linq to SQL.

Connecting by Hand

Before there was support to make things easier, a considerable amount of code was written to access databases by hand, something like the ...

Get A Programmer's Guide to C# 5.0, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.