Profiling LINQ to SQL using the DataContext.Log Property
Lately, I have been playing around with ASP.NET's new LinqDataSource. Most of my data resides in a SQL Server database, so I always configure the LinqDataSource to work with the LINQ to SQL DataContext and Entity objects. These components are still pretty new to be, so I am still kind of in awe at how it all works together so seamlessly. I guess maybe I am a little paranoid, but I don't like that using LINQ to SQL seems like magic. Sooner or later something is not going to work, and I am going to have to figure out why that is. Maybe it's a performance problem, maybe it's a data integrity issue, but sooner or later I am going to have to understand (at least a little bit) about how LINQ to SQL works so I can effectively debug my problem. I found that displaying the SQL statements the...