LINQ Mysteries: The Distinct Function
Recently I had to use the Distinct function introduced in LINQ. My surprise was that depending on where you put the Distinct clause you will receive different results. Let us take the following example: Let dtAnswers be a DataTable that has two columns, named answer_value and answer_comment. What I was seeking as a result was […]
Code Camp
On August 23, 2008 is the Jax Code Camp IV in Jacksonville. A full day of coding and free training on different technologies: WCF, LINQ, Cold Fusion, Flex/Air, Silverlight, Ruby on Rails, .Net Compact Framework, SharePoint, SQL Server 2008, and more. To sign up and see the full schedule visit the Code Camp website at […]
Division by Zero
Handling division by zero is a common need in SQL queries. Here is the standard way of performing a check if divisor is zero using the CASE function. — Sample tableCREATE TABLE Foo ( keycol INT PRIMARY KEY, x INT, y INT); INSERT INTO Foo VALUES(1, 15, 3), (2, 10, 0); — Using CASE to check divisor for zeroSELECT keycol, […]
Top 10 T-SQL Enhancements in SQL Server 2008
As SQL Server 2008 is getting in the advances phases of release, a lot has been published about new features and changes. There have been a few enhancements to Transact SQL that will be a great help for both developers and administrators. Here is list of the top 10 in no particular order, with links […]
Having different CellEditor for different rows (Xceed WPF Grid)
Currently I needed to make an Xceed WPF Grid to have different CellEditors for one column for different rows based on a condition (in my case the condition was the content of the cell). I’ve found no info for a similar situation on Xceed’s Forums. I’ve tried using the CellContentTemplateSelector for that column but after […]
Spatial Support in SQL Server
SQL Server 2008 adds new spatial data types and methods for storing and handling spatial data. The two new data types are GEOMETRY and GEOGRAPHY. This new functionality provides great capabilities to process spatial data. Here is one brief example to demonstrate the GEOGRAPHY data type and one of the related methods. The code below […]