Blog ala Vidar

SQL, AppFrame and other cool technologies

Tag Archives: Omega

5 minutes interview #29 – Aleksandr Narožnij

First time I met Aleksandr was my first visit to Klaipeda, Lithuania. He was kind enough to pick me up at the airport in Palanga (about 45 minutes by car), even though it was late at night. Before I met him, he had been on my team at Omega AS, and from day 1 I knew we’d be good friends. Aleksandr has been my guide every time I’ve been in Lithuania, taking me EVERYWHERE, helping me buy boxers (yes, believe it or not, this is REALLY hard to find when you’re out of clean ones) and generally just being awesome! Aleksandr joined Omega in 2006 as a trainee while finishing his studies. He finished these 1,5 years ago, and has been working with PIMS in the Products-team since then.

What did you study?
I’ve been studying Computer Science at Klaipeda University for six years. I have defended the thesis “Efficiency of database table’s indexes” for my bachelor and “Implementation of decision making process’ rules model in a software system based on models transformation” for the master degree. I got excellent grades on both – true story 🙂
Studies were mainly held at the faculty of Natural Science and Mathematics; so you can imagine how many additional “important” subjects did we have: ecology, math of all various types and even social behavior deviation 🙂 Of course, I don’t remember much of what I’ve been taught, but I’m grateful to all my tutors for helping me master the main skill – skill of studying on my own.

What’s the biggest difference between being a trainee and a full-time employee in Omega UAB?
Trainee position in UAB is a dream job. After passing the standard Certification Program you are normally given some real projects to work with, however you are free to use part of your working time for exploring how things work. I came to Omega with some basic theoretical knowledge and learnt pretty much everything in practice. Many thanks to Vidar – he spent much time and effort with us trainees.
I still “google” a lot, but now I don’t have enough time to go deep into details – that’s the main difference.

At work, what’s in and what’s out of your comfort zone?
I’m a kind of a SQL guy, if you like. Anything directly related to SQL Server is what I really like working with, especially when it comes to tricky data-model questions and realization. I believe that well modeled and strictly implemented database integrity is a basis of any system of a perfect sound. There is so much to learn in the field; therefore I’ve started preparing myself for Microsoft exams.
I’m not a Web-guy for sure. I guess Web is the future, but at the moment I do not like working with web-apps.

You’re good at focusing on your projects. What’s your secret?
There is no secret – I like what I do and I do it with all responsibility. My projects are most often quite interesting and challenging. When your job is interesting and gives you satisfaction – that’s all you need to do it well. Even if I happen to work with some routine tasks, I always try making it interesting for myself.

You like taking pictures. Any favorite genre(s)?
Oh, yeah – I like the process of taking pictures. Especially when you are lucky enough to “catch” the right moment or emotion. I am always happy when I succeed in sharing the mood of the moment via a picture.
I was planning to organize something similar to a photo-club, which guys are having in Ølensvåg. Still have a desire for it, so – coming soon 🙂

Take a look at Aleksandr’s flickr album here.

NNUG and MTUG Haugesund User Group Meeting in English

The countdown to AppEd has started. ARE YOU READY TO RUMBLE?!

Thursday evening, September 30, we’ll start off with NNUG (.NET) and MTUG (Microsoft Technology) Haugesund user group meeting. First, Fredrik Kalseth, which is a well known speaker in Norway, will talk about ASP.NET MVC 2 and the news in MVC 3. After his talk we’ll have some pizza, and then Morgan Simonsen, which is also a very well known speaker, will talk about Windows 7 SP1 and System Center Virtual Machine Manager 2008 R2. And the best of all, all sessions are in English, so everyone’s welcome! Please sign up for this at—September-2010/

Auto Populate Value Lists

In AppFrame we’ve got something called value lists. These are meant to make filtering even easier. When creating your filter in for example a “Documents” CR3 form, and you choose the field “Responsible”, this of course have a foreign key to some kind of Persons-table. When choosing Responsible, why not produce a list of Persons so that you can click on the person instead of having to type in the PersonID or what ever is making it unique? Well, that’s the point of value lists. I just created a script to auto populate these, based on the foreign keys. This will only take the FKs that are bound on one column though! I’ll probably fix that tomorrow, but till then, here’s the script:

  @ForeignKeyBaseTable AS NVARCHAR(128),
  @PrimaryKeyTable AS NVARCHAR(128),
  @ForeignKeyColumn AS NVARCHAR(128),
  @PrimaryKeyColumn AS NVARCHAR(128),
  @ColumnName AS NVARCHAR(128),
  @ColumnLength AS SMALLINT,
  @IsNullable NVARCHAR(5),
  @ColumnType NVARCHAR(15),

DECLARE @SelectColumns AS TABLE (
	ColumnName NVARCHAR(128),
	ColumnLength INT,
	IsNullable NVARCHAR(5)


SELECT AS ForeignKeyBaseTable,
  OBJECT_NAME(FK.referenced_object_id) AS PrimaryKeyTable,
  FKC.constraint_column_id AS ColumnNumber, AS ForeignKeyColumn, AS PrimaryKeyColumn,
  CASE WHEN IN ('tinyint', 'smallint', 'int') THEN 'Int32'
		WHEN IN ('smalldatetime', 'datetime', 'date', 'time') THEN 'DateTime'
		WHEN IN ('float', 'decimal', 'numeric') THEN 'Long'
		WHEN IN ('bigint') THEN 'Int64'
  END AS ColumnType,
  FKColumn.max_length AS ColumnLength,
  CASE WHEN FKColumn.is_nullable = 0 THEN 'false' ELSE 'true' END AS IsNullable
	INTO #FKColumns
	FROM sys.foreign_keys AS FK
	INNER JOIN sys.objects AS O ON FK.parent_object_id = O.object_id
	INNER JOIN sys.foreign_key_columns AS FKC ON FKC.constraint_object_id = FK.object_id
	INNER JOIN sys.columns AS FKColumn
		ON FKColumn.object_id = FKC.parent_object_id
		  AND FKColumn.column_id = FKC.parent_column_id
	INNER JOIN sys.columns AS PKColumn
		ON PKColumn.object_id = FKC.referenced_object_id
		  AND PKColumn.column_id = FKC.referenced_column_id
	INNER JOIN sys.types AS T
		ON FKColumn.system_type_id = T.system_type_id
		  AND FKColumn.user_type_id = T.user_type_id
	WHERE IN ('tinyint', 'smallint', 'int', 'smalldatetime',
					'datetime', 'date', 'time', 'float', 'decimal',
					'numeric', 'bigint', 'varchar', 'nvarchar')
	  AND O.type = 'U'
	  AND LIKE 'atbl_%'
						FROM sys.foreign_key_columns
						WHERE constraint_object_id = FK.object_id
						  AND constraint_column_id > 1)
	ORDER BY, OBJECT_NAME(FK.referenced_object_id), FKC.constraint_column_id

	  @ForeignKeyBaseTable = ForeignKeyBaseTable,
	  @PrimaryKeyTable = PrimaryKeyTable,
	  @ForeignKeyColumn = ForeignKeyColumn,
	  @PrimaryKeyColumn = PrimaryKeyColumn,
	  @ColumnType = ColumnType,
	  @ColumnLength = ColumnLength,
	  @IsNullable = IsNullable
		FROM #FKColumns

	SET @SQL = '<?xml version="1.0" encoding="utf-16"?>
<afRecordSource xmlns:xsi="" xmlns:xsd="">
  <UniqueTable>' + @PrimaryKeyTable + '</UniqueTable>
  <ViewName>' + REPLACE(@PrimaryKeyTable, 'atbl_', 'atbv_') + '</ViewName>
	  <Name>' + @PrimaryKeyColumn + '</Name>
	  <FieldAlias />'

	IF @ColumnType IS NOT NULL
		SET @SQL = @SQL + '	  <DataType>' + @ColumnType + '</DataType>'

	SET @SQL = @SQL + '
	  <Size>' + CAST(@ColumnLength AS NVARCHAR(128)) + '</Size>
	  <Nullable>' + @IsNullable + '</Nullable>

	INSERT INTO @SelectColumns
	  (ColumnName, ColumnLength, IsNullable)
	  name, max_length, CASE WHEN is_nullable = 1 THEN 'true' ELSE 'false' END
		FROM sys.columns
		WHERE object_id = OBJECT_ID(@PrimaryKeyTable)
		  AND (name LIKE '%Description%'
			OR REPLACE(name, 'ID', '') LIKE REPLACE(@PrimaryKeyColumn, 'ID', ''))
		  AND name <> @PrimaryKeyColumn

		  @ColumnName = ColumnName,
		  @ColumnLength = ColumnLength,
		  @IsNullable = IsNullable
			FROM @SelectColumns

		SET @SQL = @SQL + '
	  <Name>' + @ColumnName + '</Name>
	  <FieldAlias />
	  <Size>' + CAST(@ColumnLength AS NVARCHAR(128)) + '</Size>
	  <Nullable>' + @IsNullable + '</Nullable>

			FROM @SelectColumns
			WHERE ColumnName = @ColumnName

	SET @SQL = @SQL + '
	  <Name>' + @PrimaryKeyColumn + '</Name>
  <GroupByColumns />
  <WhereClause />
  <FilterString />
  <MasterChildCriteria />

	UPDATE stbl_Database_Fields
		  ValueListRecordSource = @SQL,
		  ValueListValueMember = @PrimaryKeyColumn
		WHERE DBObjectID IN (@ForeignKeyBaseTable,
							REPLACE(@ForeignKeyBaseTable, 'atbl_', 'atbv_'),
							REPLACE(@ForeignKeyBaseTable, 'atbl_', 'atbx_'),
							REPLACE(@ForeignKeyBaseTable, 'atbl_', 'aviw_'))
		  AND FieldName = @ForeignKeyColumn

		FROM #FKColumns
		WHERE ForeignKeyBaseTable = @ForeignKeyBaseTable
		  AND PrimaryKeyTable = @PrimaryKeyTable
		  AND ForeignKeyColumn = @ForeignKeyColumn
		  AND PrimaryKeyColumn = @PrimaryKeyColumn


Who are YOU?

After reading Adam Machanic’s blog post with the title “Who Are You?” I though I’d do the same. So, who are you? I know many of my readers are Omega employees, but I don’t know who’s actually reading my blog. If you don’t mind, please leave a comment about yourself. Doesn’t matter if you’re an Omega employee or not. I’d like to know more about you, so please tell me a bit about yourself. This can include your name, company, where you live, what you do, your URL(s), twitter name or anything else you’d like to share. Please also let me know what you’d like to read (more) about at my blog.

If you want to know more about me, you can take a look at my about-page. Thanks for sharing 🙂

AppEd 2010 – Ølensvåg in ENGLISH

We are happy to announce that AppEd will be in English, and that we’ve opened it for registration for all systems engineers, except Omega PS since we’re going to host their own AppEd “over there”. Your travel will be covered by Advantage Points, but accommodation, food and other stuff will be sponsored by Omega. Before you sign up, please check with your boss if it’s ok for you to go!

For more information about AppEd 2010, please go to For registration go to “My Advantage” and locate AppEd 2010 Ølensvåg.

AppEd 2010 – Ølensvåg

Everything is now settled. It will be October 1-2. Since it was such a great success last time, most of us will be staying at Løo, and we’ll run the sessions in our meeting rooms here at Omega HQ, Ølensvåg. Unfortunately we were not able to make this available for everyone, so this offer is only available for Norwegian speaking developers. Don’t worry, as last time, we’ve planned having separate events in Singapore, U.S., and this time also Lithuania.

To register for the event, log on to TeamDocuments, Intranet, My Advantage. There you can find “AppEd 2010 – Ølensvåg”. It requires 0 points!

Last time we took a notice of “Lessons Learned”, and this time we’re offering more information about the sessions, more sessions (3 tracks!) and informing everyone at a much earlier stage. We’ve also got a couple of surprises for you, so go ahead and register for the event!

For more information about the agenda with sessions and other stuff, please visit

Outlook tips and tricks

Now that it’s official that Omega’s running Exchange I can share a couple of tips and tricks I’ve found useful. First, let’s start with how to integrate with TeamDocuments. There’s a TeamDoc called “Outlook-plug-in”. If you don’t got access to it, just let me know and I’ll add you. Under Build, you’ll find a 2007 version, which also works on 2010. Install it and then open Outlook. You’ll notice you’ve got a couple of new icons in the “Add-Ins” tab. Press Config, and choose what settings you want. Here you can select calendars to sync, if to enable TeamDoc inside Outlook and to sync contacts. After clicking “OK”, just click on the connect button and it will start to synchronize!

There’s a plug-in called TwInbox that you can use to get tweets inside Outlook. It’s pretty easy to set up, but be aware; if you’re following many people (like I do), it can get really naggy, so I’ve unchecked “Home” in preferences, so I only get mentions, directs etc. If I got spare time I only just go to 🙂

There’s also a plug-in for LinkedIn. This is not like TwInbox where you get the messages as mails or similar, but it integrates nicely in contacts and in for example mails showing the profile-pictures of those you’re connected to etc.

RSS Feeds
At the moment I’m subscribing to 218 RSS feeds. I thought it would be a great idea to get them inside Outlook, but found it to be not as good as Google Reader. The main problem was that although I marked a feed as read, it came with the same items over and over again. Pretty annoying. So, therefore I removed all subscriptions (don’t worry, I exported an OPML file from Google Reader) and right clicked the “RSS Feeds” folder, Properties, Home Page and there I put as the address. Now I can at least get Google Reader inside Outlook 🙂

Exchange 2010

Have you heard the big news? We’re changing from our own mail-system to Exchange 2010! This means everyone in Omega will be able to use Outlook to everything. And by everything I mean not just mail, but calendar, contacts +++. After what I’ve heard it might already be up and running within a couple of weeks. There will be an integration with our Persons-form (with all our contacts) which will be synced to AD so everyone’s got read-only access to them. In addition you can of course create your own personal contacts.

Mail will still be integrated in TeamDocuments, but I’m counting on that will be the OWA (Outlook Web Access) interface.

Holiday times

Instead of taking vacation in the summer I’ve chosen to do it now since it’s so close to Christmas. So, what does Vidar do when he’s on vacation? Travel, work in the garden, renovate the apartment? No no no. I just ordered a new phone, HTC Touch HD2 as well as 8 GB RAM and 4TB disk etc for my server. I’m going to set up a Hyper-V server with 7 virtual servers. I’m going to run my own AD controller, SQL Server (with 6 instances, for testing purposes), Exchange, BizTalk and SharePoint. And last but not least, home server. I’ve been running this before, but now they’ve finally got real support for windows 7, so I’m going to run it again. So, why am I doing this? Well, now that I’m not in the technology department anymore, I’m “limited” to do research on my spare time. I still haven’t touched SharePoint or BizTalk. I’ve installed Exchange before, but never played with it. Will it be useful? Probably not, but I’ll definitely learn much and maybe get some great ideas on how to improve our systems.

In addition to my new server, I’m playing around in Visual Studio 2010 Beta2. I’ve now learned to LOVE XAML. I’ve played a bit with Silverlight, but mostly with WPF. I hope we’ll soon get over to this. Maybe CR4? 🙂 So, this blog post is just a notice that “be aware of a series of blog posts!”.

Oh, I almost forgot. Get ready for some cool sessions at NNUG next year. First of will be how to create an application running Azure, SQL Azure, Silverlight and WCF RIA Services.


I have set up a wiki for AppFrame developers. You can find it here. NB! This might not be available for some users (outside the Omega network), but will hopefully be available Monday morning. The reason this is set up is to gather all our resources, including all TeamDocuments like “Snippet Library”, “Technical problems for technical geeks” and similar. It is NOT set up to replace, and this will still be our portal for developers. The difference will be that will be “professional” articles, while wiki will be copy/paste code, small tips & tricks etc.

In the main page you’ll see two main headlines; Development and Setup & Maintenance. Under Development you’ll find the most important categories. Click for example “AppFrameR3” and you’ll be referred to the category which shows all articles in this category.

So, how do you start using wiki? First you of course need to register. After that’s done, you can click any “edit” you want. We’re using mediawiki (the same engine as which means that there are some tags that are special here. You can use most HTML tags, but also a couple of mediawiki special tags. For a list of all, go to this site. To add an article to a category, just add the following:

Also, you can edit existing articles to see which tags are used. The longest article so far is a copy of my AppFrame Security blog post.

The most used formatting tags are:

’’’’’bold & italic’’’’’

=Heading, level 1=
==Heading, level 2==

* Bullet list one
* Bullet list two
** Bullet list three, child of two

# Numbered list one
## Numbered list two, child of one

<source lang=”tsql”>
    FROM Table

[[Main Page]]
[[Main Page|Link to Main Page]]
#REDIRECT [[Main Page]]
[[:Category:YourCategory|Link to YourCategory]]
[ email me]