Jeff Wilcox Blog about Unit Testing with Silverlight 2 (http://www.jeff.wilcox.name/2008/03/silverlight2-unit-testing/) Hope its still up-to-date.
SQL Server Isolation Level Snapshot & DTC Promotion
SQL Server transaction isolation level Snapshot cannot be promoted by DTC. In case you open a transaction scope in .NET code, using isolation level snapshot, then open a connection, leave that connection open, and try to open another connection, you will retrieve an exception saying that a snapshot transaction cannot …
Continue reading “SQL Server Isolation Level Snapshot & DTC Promotion”
Silverlight Resolve Static Resource
Having trouble once again to resolve a static resource in Silverlight code, even though Styles.xaml is located inside the Assets directory? Have a look at app.xaml if Application.Resources contains the following entry: <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source=”Assets/Styles.xaml”/> </ResourceDictionary.MergedDictionaries></ResourceDictionary>
.NET 4.0 GAC Location Has Changed
Think it’s worth mentioning that the default GAC location has changed in .NET 4.0 from %windir%\assembly to %windir%\Microsoft.NET\assembly.
XML Data Row Truncation At 2,033 Chars When Using SqlDataReader
When you read Extensible Markup Language (XML) data from Microsoft SQL Server by using the SqlDataReader object, the XML in the first column of the first row is truncated at 2,033 characters. You expect all of the contents of the XML data to be contained in a single row and …
Continue reading “XML Data Row Truncation At 2,033 Chars When Using SqlDataReader”
Calculate WeekOfYear from DateTime
using System;using System.Globalization ;namespace ConsoleApplication1{ class Class1 { [STAThread] static void Main(string[] args) { DateTime dt = DateTime.Now; System.Globalization.Calendar objCal = CultureInfo.CurrentCulture.Calendar; int weekofyear = objCal.GetWeekOfYear(dt, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); Console.WriteLine(weekofyear.ToString() ) ; } }}
Remove Silverlight Cookies
They are located at C:\Users\username\AppData\LocalLow\Microsoft\Silverlight Just remove the whole subdirectory silverlight.
Redirect SQL Print Output in C#
To redirect the output generated by the T-SQL print statement, use the SqlConnection.InfoMessage event in your C# code. It is called each time print is used inside a stored procedure. The event argument SqlInfoMessageEventArgs.Message contains the output.
Wrap Methods With Same Frame Functionality
Sometimes one have to write several methods in one class having the same “frame” functionality, e.g. a try/catch block with logging inside the catch. Instead of copying this try/catch block all the times, one can create a wrapper for these methods. The goal is to have the try/catch block only …
Continue reading “Wrap Methods With Same Frame Functionality”
Extract Files From .msi
Usually it is possible to use your favorite compression utility to treat a Microsoft Installer Package (MSI) like it is a normal archive. Though, sometimes this does not work. In this case one can use the Windows Installer Tool (msiexec.exe) to extract the files from the MSI package. The tool …