Archive for November, 2008

Full text search is probably the best tool when it comes to searching through large amount of database data and has come a long way since the early versions of SQL server in of performance but also with more languages, being supported in each new version. But even though SQL Server 2008 now supports more than 50 diverse languages, according to msdn documentation, there is still no support for Greek in Full Text Search preventing us from building Greek localized applications that will take advantage of this SQL server feature.

So I’ve opened a new issue at Microsoft Connect asking for Greek support in SQL server 2008 Full Text Search as soon as possible, so if Greek FTS is something you need in your application go vote for it.

There are many occasions (at least so I’ve discovered) were you need to re-use user controls that you’ve created. A solution in those cases would be to convert your user control to a custom control, compile it into an assembly which is then going to be shared to all projects needed. The problem is, that you can’t easily convert a user control to a custom control cause you have to write all that render html methods to render exactly as the user control looks like.

PublishWebSite An alternative that I find pretty handy in cases like that, is moving the user controls that I want to be able to reuse in a separate website. By doing that I’m able to build and test my controls separately from any project that is going to use them. When I want to use the shared controls on a website I use the publish website option from the context menu and choose the use fixed naming and single page assemblies option from the dialog that popups.


This way I get a single dll for each web user control in the controls web site, with a fixed name. Next I register those dlls (copy them on the bin folder) on the consuming site. I then place a placeholder where I want my control to be loaded and from the code behind I load the control and add it to my placeholder’s controls collection. The code looks something like that

   1: try
   2: {
   3:     UserControl dynamicControl =
   4:         Activator.CreateInstance("App_Web_mycustomcontrol.ascx.cdcab7d2", 
   5:         "ASP.mycustomcontrol_ascx").Unwrap() as UserControl;
   6:     controlPlaceHolder.Controls.Add(dynamicControl);
   8: }
   9: catch (Exception ex)
  10: {
  11:     Debug.WriteLine(ex.Message);
  12: }

As you can see the compiler generates a class that inherits from your code behind *.cs file and that contains all the code to render the html contained in the control. That’s the class you need to instantiate. By default the class name is the control’s name with all chars lower case with the extension included. If you’re not sure about the class name or get a runtime exception saying that can’t create the type specified just use reflector on your generated assembly to verify that you’ve entered the names correctly, you’ll find the right class under the ASP namespace.

I’m attaching a sample solution to check how this works and play around with it. Hope this will help you solve some of the problems you might face …

MVP Open Day

Categories: Off Topic
Comments: 1

Today I had the chance to meet with my fellow MVPs and our lead Alessandro Teglia on the first Greek MVP open day.

It’s an event that is meant to bring MVPs closer, motivate us and give us an opportunity to meet and discuss the community and MVP program problems but most of all have fun.

It was really fun, we talked about several things and all I have to say is that really cool things are coming really really soon. Anyway I really enjoyed networking with all these great people and hope that we’ll have the chance to do something similar really soon.

As promised yesterday, I’m publishing the slide deck I used as well as the demo source code I used. Stay tuned to get notified when the video of the event gets published on DotNetZone.

I had a great time discussing how Dynamic Data and ADO.NET data services work although I was pretty stressed out at the beginning with a number of technical problems (network was down, projector didn’t work etc) and catching up with some old friends.

Looking forward to do it again…

This year TechEd had a surprise for me…

Playing in a game at the speaker idol booth I got to win a brand new HTC mobile phone. Luckily (or not this depends on how you look at it 😉 there were a couple of my fellow delegates around to capture this in camera. So to be even more embarrassed here I am winning the HTC…

Swag Winning

Right after getting back from Barcelona, on Wednesday the 19th of November, I will be giving a talk for the DNZ community at Microsoft offices about all things Dynamic in.Net 🙂 Things I will talk about include:

Dynamic Data Web Sites:

  • Creating a Dynamic web site
  • Customizing Look and Feel
  • Connecting to a Database
  • Scaffolding
  • Further Customization of the site

Microsoft SQL Data Services:

  • · Pre-Reqisities
  • · Selecting a data source
  • · Creating a service using ADO.NET Entity Framework
  • · Creating a service from any data source
  • · Structure of Web Data Services URLs
  • · Querystring options
  • · Expression Syntax
  • · Data Representation
  • · Consuming (Selecting, updating, deleting ) a data service

So if you’re interested into these drop by and say hello…

More about the event here

Last year I used photos to capture the event and although these were great pictures they didn’t actually capture the event vibe so this year I’ve decided that I wouldn’t take any pictures. Instead I brought my video camera with me and decided to get everyone in. So here it is first day’s video.

I hope that I’ll find some time later on to give you my opinion of TechEd first day till then enjoy the video.

TechEd Day1 video

I’ll be at TechEd in Barcelona next week. I’ll be at the Ask The Experts booths a few hours during the week. Feel free to come and say hello. I’ll be available if you want to discuss about ASP.NET, my projects – work , or .NET in general 🙂

Please ping me if you’ll be there too and would like to meet.

Most of the people I meet have this idea that they have to either buy or find an open source third party component, or (even worse) use flash, when it comes to drawing graphs for a web application or site. So I’m guessing that most people don’t know that the Data Visualization Group within the SQL Server Reporting Services Team has created stand-alone ASP.NET and Windows Forms Chart Controls for the .NET Framework 3.5 and Visual Studio 2008, similar to what has been already available as built-in chart functionality in SQL Server Reporting Services 2008.

Free ASP.NET Chart Controls

There are several links to get the “full package” for these free chart controls:

  • First, you can download the ASP.NET and Windows Forms Chart Controls for .NET Framework 3.5 SP1 here.
  • Then download the Language Pack for the Free Microsoft Chart Controls here.
  • Download the Microsoft Chart Controls Add-on for Microsoft Visual Studio 2008 here. This package provides Visual Studio toolbox integration and IntelliSense for the ASP.NET and Windows Forms Chart controls.
  • Last but not least, download the documentation and API for the free ASP.NET and Winform Chart Controls here.

You can also check-out some samples for the Microsoft Chart Controls as well as discuss them in the forums.