SQL Server - Reporting services - Integration services - Analysis Services - WCF - Lightswitch
Friday, December 03, 2010
Prepare a SQL server database restored from sql 2000 for full text search
Setting up your Facebook account to use your friends as contacts in your phone 7: create the facebook account with email address and facebook password and you are ready to go.
So far so good.
Friday, June 25, 2010
Quebec 2010_06_10 Les Hautes Gorges de la Malbaie
Tuesday, June 22, 2010
2010_06_13 Sea-kayak at L'Anse St-Jean (Saguenay fjord)
2010_06_18 quebec city
Wednesday, June 09, 2010
Mauricie dag 5
Lang geslapen. Voor het ontbijt mochten we zelf de eitjes bij de kippen gaan roven. Naar het dorp Saint-Jean-des-Piles vlakbij het park om onze kayak te reserververen. We krijgen de roeispanen en reddingsvesten mee, aan het meer bij het park moeten we dan gewoon een kayak nemen en wegroeien. Een tocht met de wagen van 3 kwartier tot aan Lake Wapizigonke, wagen geparkeerd en met roeispanen tot aan strand bij meer waar de kayaks liggen. Met de kayak een uur gevaren op 2 stukken van het meer die via het moeras en een beverdam aan elkaar verbonden waren. Na een uur beland bij het voetpad dat naar Waber waterval leidt. Nog 2 uur gewandeld en dan terug een uur met de kayak. Met de wagen terug naar B&B, nog wat eten en praten met de andere gasten.
Mauricie dag 4
Laatste ontbijt in Montreal. Met de express bus naar Montreal airport om huurwagen op te halen. Met de wagen via de highway naar le Parc National de la Mauricie. 's middags aankomst aan l'auberge de saint Maurice. Een wandeling van 7 km in het park. OM 19:00 met de gids naar beren gaan kijken, in een observatiehut, na een uur een grote zwarte beer gezien. Gaan eten en slapen.
Monday, June 07, 2010
Montreal dag 3
Regen van 's morgens tot 's avonds. Bagel geproefd in bakkerij. Dome bezocht. Museum van moderne kunst. Shopping, alles binnendeurs.'s avonds liitle Italy om een spaghetti te eten. Geen fietstocht want te nat en te fris.
Sunday, June 06, 2010
Montreal dag 2
Lekker ontbij met wafels, vers fruit en esdoorn siroop geserveerd door Philippe de gastheer. Kennis gemaakt met een amerikaans koppel dat ook verblijft in het B&B. Met de metro naar oud montreal - wandelen door de stad - kathedraal - stadhuis waar ze een nieuwe spits op de toren plaatsten - de haven met het cirque de soleil - aan de pier de klokketoren beklommen - er was ook een herdenking voor de gesneuvelden met saluutschoten en last post - wandelen door de ondergronds stad - shopping - iets gekocht in een supermarkt om te eten 's middags. namiddag nog wandelen - china town - in de avond eten in een vegetarisch thai restaurant zeer lekker. - vroeg gaan slapen.
Saturday, June 05, 2010
Montreal dag 1
Vlucht met air transat - aankomst Pierre Trudeau Airport 10:50 - declaratie douane 3 appels
Express bus van airport naar Bus station bij Universiteit - 3 blokken verder gaan met valies naar ons B&B Le Saint-andré des arts
Goed onthaal door Philippe onze gastheer - espresso machine in de keuken - verfrist - met metro naar Montreal Olympic park en botanical gardens - gewandeld door het park - zeer groot - veel eekhoorns
Terug met metro naar B&B - verfrist - Metro naar bistro 'Station F' zeer lekker eten.
Slapen.
Monday, May 24, 2010
Kortrijk loopt
Today I ran my first 11 km in 'Kortrijk loopt', a yearly running event. My time 1:10:52, or an average of 9.31 km/h. I had been preparing this run by slowly building up this winter, until I ran 11 km some 2 weeks ago. The last week I ran 11km twice, then 3km on saturday, rest on sunday and then ran the above mentioned time today.
Friday, May 14, 2010
silverlight 4 training kit and Silverlight 4 MVVM video
It can be downloaded from here
Via RSS feed in VS2010 I found this training video for Silverlight 4 MVVM
Monday, May 10, 2010
Patterns of Enterprise Application Architecture
Friday, April 30, 2010
.NET Framework remove tool from Aaron Stebner
Via google I found Aaron Stebner's blog where one can download a handy utility '.NET Framework Cleanup Tool'. This tool helped met in removing the last remains of version 4.0. After the cleanup I was able to install the .NET Framework 4.0 again and continue my real work.
The tool can be found here
Monday, April 19, 2010
Understanding and Using APPLY in SQL Server
Understanding and Using APPLY (Part 2)
Friday, April 02, 2010
how to update the window in WPF while performing computations
Michael Covington's site
Monday, March 29, 2010
Debug wcf service with IIS on Vista
run command prompt as administrator, and run the following command -
"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" -r -y
credit goes to this guy
Tuesday, March 23, 2010
Debug in VS2008 with local IIS server on Vista pc
Steps to be taken:
- In visual studio, go to the properties of your website project. From the diffferent tabs (Application, compile,...) choose Web.
- Under 'Servers', select 'Use local IIS server'.
- the default project url is http://localhost/myproject . Click the 'Create virtual directory' button.
- This message pops up : you need to install the "IIS Metabase and IIS6 Configuration Compatibility" feature under Internet Information Services-Web Management Tools-IIS 6 Management Capability to get the IIS6 ADSI provider installed.It means that IIS is not installed or not fully configured on this pc.
- Close Visual Studio
- Open Configuration panel , select Add/Remove programs. On the left you have a link to 'Turn Windows features on or off'. Click this link.
- In the dialog box scroll to 'Internet Information services' / 'Web management and enable 'IIS Metabase and IIS6 Configuration Compatibility'.
- Next you need to enable ASP.NET under the same 'Internet Information services' select Developer functions and check ASP.NET.
- Click OK. this will take some minutes.
- Open the visula studio project again and in the Web properties, click on the Create Virtual Directory. this should work now.
Thursday, March 11, 2010
Wednesday, March 03, 2010
SQL 2008 - enable database for full text search
The database needs to be readied to use full text search.
Set the database to compatibility level server 2008.
Here is the transact SQL:
-- enable full text search on a sql 2008 server - database was restored from sql 2000
USE [master]
GO
-- examine the current compatibility level
EXEC sp_dbcmptlevel 'MyDatabase'
go
-- change the compatibility level
ALTER DATABASE [MyDatabase] SET COMPATIBILITY_LEVEL = 100
GO
Create a stoplist
In case the system stoplist does not contain a stopword that you require
USE MyDatabase
GO
-- find out if a specific stopword is in use
select * from sys.fulltext_stopwords where stopword = 'de'
GO
-- in case the system stoplist is not sufficient, create your own
CREATE FULLTEXT STOPLIST myStoplist FROM SYSTEM STOPLIST;
GO
Wednesday, February 17, 2010
Silverlight DataForm with Combobox
Monday, February 15, 2010
Using the Silverlight Treemap and WCF RIA services to display business data
Introduction
A client of mine wanted to visualize his customers by city they live in. His customer addresses reside in the SQL server database I've set up for him.
Since I have started development of a small sales force Silverlight app for him, I looked at what could be done with Silverlight to visualize his data. There are several possibilities, such as visualization on a Bing map, but to start off and keep it simple and to avoid spending too much time on this, I decided to use the Treemap control.
Background
The data is stored in an Address table in a database in SQL Server 2008. All the Addresses are located in Belgium and have all been given a City name and zip code.
The Silverlight project is written in Visual Studio 2008 with Silverlight 3 and WCF RIA services beta.
References
Treemap in Silverlight 3 article by Diptimaya Patra in c-sharpcorner.
Using stored procedures in the Entity Framework by Julie Lerman in thedatafarm.
Articles about WCF RIA services by Brad Abrams, Tim Heuer and many others.
The result
The screenshot at the top of this article shows the result: a Treemap control that visualizes the addresses per city. The cursor was hovering over the city of Bruges (Brugge) with 70 customers.
The solution
The Data tier: SQL Server
The SQL server database needs a view or stored procedure that groups the addresses by city and zipcode. Larger cities have different zipcodes for one city name, so the city and zipcode need to be concatenated. Since my middle-tier is going to be WCF RIA services and the Entity Framework, I need a result that has a primary key too. And because of a blatant problem with the Entity Framework designer that does not allow you to specify a primary key field on a view, I'll have to fake my primary key.
Stored procedure
Use a stored procedure to make it fit in my Entity Framework. The stored procedure uses ROW_NUMBER() as a column with name ID and this will be my primary key column.
The procedures returns a recordset with 4 columns: ID, Gemeente, Tooltip, Aantal.
CREATE Procedure dbo.upAddressTreemap
AS
BEGIN
SET NOCOUNT OFF;
SELECT CONVERT(int,ROW_NUMBER() OVER (ORDER BY Gemeente, Zipcode)) AS 'ID'
,RTRIM(City + ' ' + Zipcode) AS Gemeente
, City + '-' + Zipcode + ' Aantal:' + Convert(varchar,COUNT(*)) AS Tooltip
, COUNT(*) AS Aantal
FROM dbo.Contact
GROUP BY City, Zipcode
END
The first 3 records of the recordset can be seen here:
ID | Gemeente | Tooltip | Aantal |
1 | Aalbeke 8511 | Aalbeke-8511 Aantal:7 | 7 |
2 | Aalst 9300 | Aalst-9300 Aantal:5 | 5 |
3 | Aalter 9880 | Aalter-9880 Aantal:18 | 18 |
Dummy table
Because I do not like to edit xml in the entity framework edmx file, I create a dummy table that will only be read by the Entity Framework designer.
The table contains the same fields as the resulting recordset of my stored procedure. This table will be used by the framework designer, later I will add the stored procedure in the Entity framework and map it to this table.
CREATE
TABLE [dummy].[AddressTreemap](
[ID] [int] NOT
NULL,
[Gemeente] [varchar](100)
NOT
NULL,
[Tooltip] [varchar](100)
NOT
NULL,
Aantal [int] NULL,
CONSTRAINT [PK_ AddressTreemap] PRIMARY
KEY
CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX
=
OFF,
STATISTICS_NORECOMPUTE
=
OFF,
IGNORE_DUP_KEY
=
OFF,
ALLOW_ROW_LOCKS
=
ON,
ALLOW_PAGE_LOCKS
=
ON)
ON [PRIMARY]
)
ON [PRIMARY]
The middle tier: EF and WCF RIA services
The standard procedure to make a Silverlight database application is to create an entity framework edmx file in the Web project and to add a Domain Service class based on this entity framework.
The Entity Framework designer has problems using views when it cannot find a primary key. My solution is to create a dummy table with the necessary fields and the primary key. Then to add a stored procedure to the EF and to map this procedure to the dummy table.
The solution to this is based on the article by Julie Lerman.
Entity Framework
In Visual Studio 2008 in my Silverlight.Web project I had already added an ADO.NET Entity Data Model.
Step 1
Create the Entity with the designer wizard to add the dummy table and the stored procedure.
The dummy table is shown as an entity on the design surface.
The stored procedure can be found in the model browser in the Stored procedures section of the model store.
Save and build this model.
Step 2
Add an import function in the model browser, by rightclicking on the stored procedure name in the model browser. The return type is the AddressTreemap Entity.
The result in the model browser
Skip Step 3 and 4.
Step 5
To be checked.
Domain Service Class
Save and build the project.
Add a domain service class to the project. I work with partial classes so I can recreate the Domain service class whenever my entity framework changes.
I make the generated AdressenService class partial and then add a new class with the filename AdressenService.partial.cs. I use new this partial class to add all my custom methods. Whenever the Entity model changes, I can regenerate my DomainService class without losing my custom code. This tip I found in an blog post by someone else, but I cannot remember the link any longer.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Adressen.Web
{
public
partial
class
AdressenService
{
public
IQueryable<AddressTreemap> GetAddressTreemapSproc()
{
AddressTreemap entities = new
AddressTreemap ();
System.Data.Objects.ObjectResult< AddressTreemap > dbResults =
this.ObjectContext.upAddressTreemap();
return (IQueryable< AddressTreemap >)dbResults.AsQueryable();
}
}
}
Save and build the project. This finalizes our middle-tier section.
Presentation tier
To finish off, the result will be displayed in a Silverlight Page with a Treemap control and with the RIA services DomainDataSource control. Everything will be handled in xaml, no code behind will be needed.
DomainDataSource
In the UserControl attributes section add a reference to the Silverlight.web application
xmlns:App="clr-namespace:AdressenTreemap.Web"
In the Grid section add a Grid resources collection that refers to the App namespace
<Grid.Resources>
<App:AdressenContext
x:Key="adressenContext"/>
</Grid.Resources>
Drag a DomainDataSource control from the toolbox in the Grid section. This will automatically add the namespaces.
xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
The DomainDataSource has the following properties: Autoload True, QueryName refers to the method we made in the partial class.
<riaControls:DomainDataSource x:Name="ddsTreemap" AutoLoad="True"
QueryName="GetAddressTreemapSprocQuery"
DomainContext="{Binding Source={StaticResource
adressenContext}}">
</riaControls:DomainDataSource>
Sorting has been added out of the experience I've had with datagrids: If I do not specifiy sorting , then most often you get errors.
For sorting, add the following namespace
xmlns:datagroup="clr-namespace:System.Windows.Data;assembly=System.Windows.Controls.Ria"
Sorting is done on the ID column of the datasaource.
<riaControls:DomainDataSource … <riaControls:DomainDataSource.SortDescriptors>
<datagroup:SortDescriptor PropertyPath="ID"/>
</riaControls:DomainDataSource.SortDescriptors>
</riaControls:DomainDataSource>
Treemap
Drag a treemap control onto the grid, below the DomainDataSource. This automatically adds a reference to the following namespace:
xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
The treemap has to use the data from the DomainDataSource. A Data range from Blue (most) to Magenta (least) is specified.
<visualizationToolkit:TreeMap x:Name="trm" ItemsSource="{Binding Data, ElementName=ddsTreemap}"
>
<visualizationToolkit:TreeMap.Interpolators>
<visualizationToolkit:SolidColorBrushInterpolator TargetName="itemBorder" TargetProperty="Background"
DataRangeBinding="{Binding
Aantal}" From="Blue" To="Magenta" />
</visualizationToolkit:TreeMap.Interpolators>
<visualizationToolkit:TreeMap.ItemDefinition>
<visualizationToolkit:TreeMapItemDefinition ValuePath="Aantal">
<DataTemplate>
<Border x:Name="itemBorder" BorderBrush="Black" BorderThickness="1" ToolTipService.ToolTip="{Binding
Tooltip}">
<TextBlock x:Name="trmGemeente" Foreground="White"
Text="{Binding
Gemeente}" VerticalAlignment="Center"
TextAlignment="Center" TextWrapping="Wrap"/>
</Border>
</DataTemplate>
</visualizationToolkit:TreeMapItemDefinition>
</visualizationToolkit:TreeMap.ItemDefinition>
</visualizationToolkit:TreeMap>
</controlsToolkit:DockPanel>
Layout and user experience
To round up, I added grid columns and rows to center my treemap in the page.
To show the user the data is loading I've added a BusyIndicator.
To explain what is being displayed, a Dockpanel was used in which a textbox was added with an axplanatory title together with the t
Below is the final xaml code (example was made in a masterpage).
<UserControl
xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:datagroup="clr-namespace:System.Windows.Data;assembly=System.Windows.Controls.Ria"
xmlns:App="clr-namespace:AddressTreemap.Web"
xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Ria"
xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
x:Class="AddressTreemap.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<controlsToolkit:BusyIndicator x:Name="busyIndicator"
IsBusy="{Binding IsBusy, ElementName=ddsTreemap}"
BusyContent="Bezig met laden" Grid.RowSpan="3" Grid.ColumnSpan="3">
<Grid x:Name="LayoutRoot" Margin="-8,8,8,-8">
<Grid.Resources>
<App:AdressenContext
x:Key="adressenContext"/>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.1*"/>
<ColumnDefinition Width="0.8*"/>
<ColumnDefinition Width="0.1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition Height="0.8*"/>
<RowDefinition Height="0.1*"/>
</Grid.RowDefinitions>
<controlsToolkit:DockPanel LastChildFill="True"
VerticalAlignment="Top" Grid.Column="1" Grid.Row="1" d:LayoutOverrides="Width" Height="384">
<riaControls:DomainDataSource x:Name="ddsTreemap" AutoLoad="True"
QueryName="GetAddressTreemapSprocQuery"
DomainContext="{Binding Source={StaticResource adressenContext}}">
<riaControls:DomainDataSource.SortDescriptors>
<datagroup:SortDescriptor PropertyPath="ID"/>
</riaControls:DomainDataSource.SortDescriptors>
</riaControls:DomainDataSource>
<Grid x:Name="gridTitel" Background="DarkGray"
controlsToolkit:DockPanel.Dock="Top">
<TextBlock x:Name="txtTitel" Text="Verdeling per gemeente van adressen voor mailing met de post"
TextAlignment="Center" TextWrapping="Wrap" Height="32" FontSize="18"
Foreground="White"
Margin="2"/>
</Grid>
<visualizationToolkit:TreeMap x:Name="trm" ItemsSource="{Binding Data, ElementName=ddsTreemap}"
>
<visualizationToolkit:TreeMap.Interpolators>
<visualizationToolkit:SolidColorBrushInterpolator TargetName="itemBorder" TargetProperty="Background"
DataRangeBinding="{Binding Aantal}" From="Blue" To="Magenta" />
</visualizationToolkit:TreeMap.Interpolators>
<visualizationToolkit:TreeMap.ItemDefinition>
<visualizationToolkit:TreeMapItemDefinition ValuePath="Aantal">
<DataTemplate>
<Border x:Name="itemBorder" BorderBrush="Black" BorderThickness="1" ToolTipService.ToolTip="{Binding Tooltip}">
<TextBlock x:Name="trmGemeente" Foreground="White"
Text="{Binding Gemeente}" VerticalAlignment="Center"
TextAlignment="Center" TextWrapping="Wrap"/>
</Border>
</DataTemplate>
</visualizationToolkit:TreeMapItemDefinition>
</visualizationToolkit:TreeMap.ItemDefinition>
</visualizationToolkit:TreeMap>
</controlsToolkit:DockPanel>
</Grid>
</
controlsToolkit:BusyIndicator>
</UserControl>
Conclusion
With some creative computing on the database side, I was able to give my client a new visual presentation of his business data with minimal development time.
Monday, February 08, 2010
Hyperlink button style as command button
hyperlinkbutton
Debug WCF RIA services with Fiddler
The service address is http://
Silverlight 3 and WCF RIA services 'not found' error
System.Componentmodel.DataAnnotations.dll
System.Web.DomainServices.dll
System.Web.DomainServices.EntityFramework.dll
System.Web.Ria.dll
For my latest application I had followed the directives as I found them on some websites and only copied the last 3 dll's to the bin folder. Which made sense because you get errors on the silverlight pages. But when I tested the application I got 'not found' errors when trying to read data. The System.Componentmodel.DataAnnotations.dll needs to be there as well for the RIA services to work.
Tuesday, February 02, 2010
Fiddler and Charles
Friday, January 29, 2010
Visual Studio 2010 beta 2
Visual studio difference between Silverlight Navigation application and Business application
Silverlight Business application adds login/logout support.Using partial classes to spread a Domain Service across multiple files
Problem
You need a few extra methods in the Domain Service generated from the entity model, most often because you want to create selection methods with other criteria for filtering. You can add these in the Domain Service class. But if for some reason your entity model changes then the Domain Service needs to be regenerated too, causing all your custom code to disappear.Solution
Create a partial class to spread a Domain Service across multiple files.Modify the generated Domain Service class to partial, e.g.
[EnableClientAccess()]
public partial class NorthwindDomainService : LinqToEntitiesDomainService<northwindEntities>
{
Add a new class to the web project, with the same class name but with the extension 'partial.cs' instead of '.cs', e.g.
public partial class NorthwindDomainService : LinqToEntitiesDomainService<northwindEntities>
{
Add the using statements from the generated class to your custom class.
In case you need to regenerate the entity model and the class, you only have to add the word 'partial' to your generated Domain Service class. Your custom class will be kept as is.
Visual Studio 2010 Beta 2 DataGrid bugVisual Studio 2010 Beta 2 has a little bug that when creating the DataGrid control it added subcontrols <controls:DatePicker in the "controls" namespace which is properly set toxmlns:controls="clr-namespace:System.Windows.Controls; assembly=System.Windows.Controls" but it didn't add a reference to the required library "c:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.dll" Add this reference manually. |
Thursday, January 28, 2010
Silverlight application themes for Silverlight 4
I have used the silverlight application themes from Tim Heuer in the Visual Studio 2010 beta with Silverlight 4 and they work.
- Put the Style.xaml that you downloaded from one of the themes in the Assets folder of your Silverlight project.
- Overwrite the existing one.
- In VS 2010 select the Style.xaml and change the property Copy to output directory into 'Copy always'.
Silverlight 4 WCF RIA Services Line of Business Application Hands-On Lab
In this 108 page hands-on lab you will learn how to use Beta 2 of Visual Studio 2010 and Beta 1 of Microsoft Silverlight 4 to create a data driven line of business style rich internet application that implements many of the new features that Silverlight 4 introduces.
These features are implemented in the lab:
- True multi-tier architecture.
- Entity framework and service layer definition.
- Data filtering, paging, sorting and grouping.
- Data modification and validation.
- Foreign key management.
- Projections.
- Programmatic printing from a Silverlight application.
- COM interop with Microsoft Excel and running full-trust out-of-browser.
Great work from Sascha Corti and Ronnie Saurenmann!
Saturday, January 16, 2010
Monday, January 04, 2010
Silverlight 3 How to display the version number of my silverlight assembly
In the Silverlight forums I found a simple solution by PBROMBERG:
Assuming that the xaml page contains a textblock txtVersion with no text.
Assembly asm = Assembly.GetExecutingAssembly();
string[] parts = asm.FullName.Split(',');
txtVersion.Text = parts[1];
the resulting version info will be displayed like:
Version=1.0.2.0