Fabrice's weblog

Tools and Source

News


Read sample chapters or buy LINQ in Action now!
Our LINQ book is also available on AMAZON

.NET jobs

Emplois .NET

The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer. The content of this weblog is independent from Microsoft or any other company. transatlantys hot news

Contact

Me

Others

Selected content

Browse by Tags

All Tags » Tips (RSS)
Randomizing LINQ to SQL queries
Yesterday, a developer asked in the LINQ in Action forum and in Microsoft's official LINQ forum how to write a LINQ to SQL query that would return random records from the database. It's not something built-in. There is no Random query operator provided...
Rethrowing exceptions and preserving the full call stack trace
Did you know that depending on the way you rethrow exceptions you may lose important information? There are already several blog posts that explain and demonstrate the difference between throw and throw ex . I'm realizing only now that none of the two...
Hunting down bad try..catch blocks
Way too often developers take the easy solution to use try..catch blocks to silence and ignore exceptions. There are two things to do when you see this happening: Explain the developers why it's a bad practice (exceptions are costly and their use should...
Use the power of let in your LINQ queries
Often, when you try to find out how to write the correct LINQ query you need, you end up being confused because it becomes too complex. In such situations, you should remember that the let clause is here to help you. Let's see is an example from the official...
Sending the LINQ to SQL log to the debugger output window
When debugging LINQ to SQL code, did you wish you could easily see the SQL that gets executed? Of course there is the DataContext.Log property that is available for that. You can assign any TextWriter to this property. Console.Out is a good candidate...
Rationalize your build process with code mobility
Patrick Smacchia, C# MVP, author of the best-seller Practical .NET2 and C#2 and creator of NDepend , has started to blog . In his second post, Patrick proposes a simple trick to rationalize your code environment and build process . Basically, he explains...
Posted: Jul 10 2007, 02:47 PM by Fabrice Marguerie | with no comments
Filed under: ,
Using configSource to split configuration files
As Nikhil Kothari writes in his blog , he's started to use the configSource attribute to split configuration files into smaller pieces. For example, here is how he exports the profile configuration into a dedicated configuration file. This is web...
Which type should I use in C# to represent numbers?
Luca Bolognese, from the Microsoft C# team, has an interesting post that aims at providing answers to the following question: Which type should I use in C# to represent numbers? Luca and the C# team try to provide a simple algorithm that can help when...
Exception handling and resource protection with try..finally
Paul Sheriff has just published an example he uses to recommend the use of try..finally blocks. Here is his example: private void CreateLogFile() { try { StreamWriter sw = new StreamWriter(@"D:\Samples\Test.txt", true, System.Text.UTF8Encoding...
Removing diacritics (accents) from strings
It's often useful to remove diacritic marks (often called accent marks) from characters. You know: tilde , cédille , umlaut and friends. This means 'é' becomes 'e', 'ü' becomes 'u' or 'à'...
More Posts Next page »