Codepolice

Random posts from Ola in English. Mainly about programming and the web.

Create a comma separated list with LINQ in C#

For some reason I always forget that you do not do .Join on your actual string array. So i might as well write it down here so i never forget about this again.

string mycommalist = string.Join(",", alternatives.Select(x=>x.Item.Name).ToArray())

MS10-024 and KB976323 will reset your IIS SMTP Settings

A client called me this Monday morning and told me there where some issues with one of their sites. The problem turned out to be some issues the SMTP server. After about 2-3 hours of debugging i desperately  tries to do a search on Twitter for “IIS SMTP” and to my surprise i could actually use Twitter’s real time functionality (an area where Google sucks) to figure out the solution to my problem.

Apparently the update KB976323 (Microsoft Security Bulletin MS10-024) removed all settings on your SMTP-server. How lovely and a big fail for the QA department on Microsoft. I quickly added my own server as a mail relay and everything worked again.

But the worst part of this was not that MS wiped all my settings. The worst part was that it also caused my Application Pool to crash with this fine message.

A process serving application pool ‘MyApplication’ suffered a fatal communication error with the Windows Process Activation Service. The process id was ’388′. The data field contains the error number.

And this actually made my website crash and just give the user a Http 503 error (and made quite a disturbance when i celebrated a friends birthday and started to get alerts that the site was down). Any way .. when i uninstalled KB976323 the error message changed to.

A process serving application pool ‘MyApplication’ terminated unexpectedly. The process id was ’2624′. The process exit code was ’0xe0434f4d’.

Both of these errors went away after i fixed the settings on the SMTP server but FFS Microsoft. Try to do some test on the updates you push. I want to have automatic updates turned on but i don’t know if i dare after this debacle.

jQuery free text table filter in a ASP.NET Dynamic Data List

Dynamic Data for ASP.NET is kind of a neat way to quickly build a backend admin system for any type of database you have. In 10-15 minutes you have a usable site up and running. But of course everything can’t be exactly as you want it. I wanted a way to quickly filter a list of items