Skip to main content

Posts

Unexpected error while debugging Windows Phone 7.1

Today I`ve  some strange which occurred before my debugger attached to the Windows Mobile emulator. Exception message text  was: " File or assembly name 'System.Windows.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e', or one of its dependencies, was not found . " As You can see this in not helpful and hard to resolve. But after some investigation I remembered that I changed some exception settings in my Visual Studio. All thing You need to do, when you get such error is  to turn off any other exception types than ' CLR Exceptions ". To change this in Visual Studio go to the Debug->Exceptions. Thank You.

Creating common partial class with Entity Framework

When we use the Entity Framework (EF) in multilayer information systems sometimes we want to extend classes generated by EF by adding some common properties or functions. Such operation can`t be conduct on *.edmx data model so we need to make some improvement in our solution. Let`s begin... Lets assumed that in our soulution we have only three layer (three project): Client console application which has reference to the second layer  - ' ConsoleApplication ' project name Class library project with class interfaces only - ' Interfaces ' project name Class library class implementation and data model referenced to 'Interfaces' project - ' Classes ' project name. Picture 1. Solution structure. Now when we have all solution structure we can focus on data model. In the ' Classes ' project we create a new folder named ' Model ' and inside add new item of ADO.NET Entity Data Model named ' Learning.edmx ' - it may be empty ...

Formatting XML in SQL Server 2008

Since SQL SERVER 2005 it is possible to store XML data in database by using dedicated data type - XML. This type solved many programming problems such storing XML data as simple text which was very unpleasant to maintenance  and detecting errors in document structure. Now stroring XML data is very simple and requires only the creation of column in XML data type. But sometimes we may want to do reverse operation. I mean generating XML document or fragment from non XML columns in a single SELECT statement. Of course SQL Server meets our expectations and allow to transform any results of SELECT statement (which always returns table) to XML structure. To start transforming selected results to XML format we must use FOR XML clause right after last statemnt in normal SELECT. For example instead of using: Code Snippet SELECT ProductNumber , Name , ListPrice , Color FROM Production . Product we should use: Cod...