I noticed that the dbml file stores the connection string in a Settings file, stored in the same project. I use multiple projects to separate the entities from the ui, so this is unwanted behavior. I want it to read the connection string from the app.config. This can be easily achieved: Go to the Connection [...]
Archive for the ‘Linq’ Category
Linq to Sql Profiler
I just wanted to give a shot out to the Linq to Sql Profiler. It’s a simple but invaluable tool to watch what happens behind the scenes with linq to sql. It’s a realtime visual debugger, and gives immediate feedback about the sql statements and their performance. In linq to sql, you must always profile [...]
Generic and fast Detach() in Linq-to-Sql
For the first time I’m experimenting with Linq-to-Sql (L2S). Microsoft targets L2S for the simpler scenario’s/architectures (if that scares you, just let me say that stackoverflow.com is running on L2S!). Because of this, a Detach() method is not supported. For these kind of scenario’s, Microsoft wants developers to use the Entity Framework. One could argue [...]
Timestamp and Rowversion columns
To check concurrency violations, it’s common to have a Timestamp column. This column represents some kind of version of that row, and has nothing to do with the actual time. In fact, the information is stored as binary(8) when non-nullable, and varbinary(8) when nullable. Anyway, the value in this column is being used to check [...]