Wednesday, April 29, 2009

Distinct with OrderBy operators in LINQ

Another day, another challenge.


I have to retrieve a set of distinct data rows that must be ordered by some criteria.
My problem was that first I applied OrderBy and then Distinct operator. After applying Distinct operator data ordering disappeared somehow.
The problem was that Distinct operator does not preserve ordering so you must place OrderBy operator after it. The same is valid for Union and Concat operators.


There is a good post describing this problem in detail that could be found here.


Hope this helps someone.

Regards,
Oleh

Sunday, April 26, 2009

Preserving Session state across different domains

Recently I had a task that required to add some user session dependent data. The problem was that there is one main domain and many sub domains and different browsers act differently: IE8 is generating new session id only when top level domain is changed, Google Chrome, Firefox, Safari and Opera are generating new session id when subdomain is changed so session sensitive data will be lost. Requirement was to preserve session sensitive data across different subdomains and regardless of used browser.


Solution:
The idea is to use intermediate page that will use a self submitting form containing user session sensitive data in hidden fields. The trick is that that form will actually change sub/domain by posting to itself but will preserve session sensitive data via form's hidden input fields.


The original article with solution could be found here .


Hope this helps somebody.
Regards,
Oleh

Saturday, February 14, 2009

Report Localization

In case you are interested in localizing SSRS reports you should definitely take into account approach with using hidden report parameters as described in this blog post - Laser Guided Missiles (Report Localization Though Parameters) .


Happy localizing :)
Regards,
Oleh

Windows Forms Application Development

Recently I have received an email that I have successfully passed beta TS: Microsoft .NET Framework 3.5, Windows Forms Application Development exam that I tried back in December. Unfortunately I failed the other one - Pro: Designing and Developing Windows Applications Using the Microsoft .NET Framework 3.5. Definitely I will be trying it one more time. :)
Regards,
Oleh

Wednesday, October 22, 2008

SSMS 2008 IntelliSense feature

I was really enjoying one of SSMS 2008 new features - IntelliSense. But later it was "dissappearing" and "getting back" somehow. I was connecting to five different SQL server instances. And only two of them were the latest ones (2008). I did not paid much attention to that fact as had been using SSMS 2005 for a while which had no IntelliSense builtin support. The fact that something is not under my control was disturbing me so I started to google around.

The answer was very simple and unexpected. IntelliSense in SSMS 2008 does not work for down-level systems. Then I found an interesting blog post which stated that SSMS 2008 CTP5 and CTP6 had IntelliSense support for all SQL Server down versions. It appeared that there was some kind of defect in server version check logic that allowed IntelliSense to work with down level versions.


100% percent agree with blog post author that it would be nice to have IntelliSense working with all versions. :)


Regards,
Oleh

Tuesday, August 12, 2008

VS 2008 SP1 and .Net Framework 3.5 SP1 RTM

As it was announced VS2008 SP1 and .Net Framework 3.5 SP1 had been released yesterday.
 VS2008 SP1:
.Net Framework 3.5 SP1:
Enjoy :)