# Thursday, June 03, 2004

One of the products I work with daily is Commerce Server 2000 and 2002 from Microsoft which is an interesting product trying to create a standard e-commerce platform on which you can develop your own solutions.

Anyway the product is very complex and has all kinds of nooks and crannies due to the fact that version 2000 was an ASP only product. Version 2002 has a lot of .NET classes and stuff to use but it is still just a layer added to the top of the COM objects found in version 2000.

I was tasked with creating a program which does some bulk updating using the Commerce objects. One of the tricks in Commerce Server is that it comes with a built in data abstraction layer called the profile system. A profile in the profile system is basically a table in SQL Server.

Back to the task at hand; I needed to create a ProfileContext outside of ASP.NET where it is available through a HTTP handler so I needed to figure out how to get at it without the HTTP handler doing the "heavy lifting".

First you need to add a couple of references to the COM based DLLs named ADODB.dll, AppHelper.dll, and MSCSCFG.dll. They are all found in your Commerce directory. Finally you need the managed Commerce Server runtime DLL named Microsoft.CommerceServer.Runtime.dll which is found in the Commerce Server\Assemblies directory.

Now for some code: First I needed to get the connection string for the profile system which I did in the following way: 

//

//  Get the profile connection string from the system config

//

AppConfig appConfig = new AppConfigClass();

appConfig.Initialize( ConfigurationSettings.AppSettings[ "name of your commerce application" ] );

Microsoft.CommerceServer.Runtime.IDictionary configDictionary = appConfig.GetOptionsDictionary( "" );

string profileConnectionstring = Convert.ToString( configDictionary[ "s_ProfileServiceConnectionString" );

 

//

//  Instantiate the ProfileContext object

//

string profileDefinitionCatalog = "Profile Definitions"; // You can look this value up in the Commerce Manager

ProfileContext profileContext ProfileContext( connectionString, profileDefinitionCatalog, new ConsoleDebugContext( DebugMode.Production ) );

 

posted on Thursday, June 03, 2004 11:03:32 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

I must be a nutter :) I just love getting a new beta release to try out. Here is the first Windows Media Player 10 beta.

Update: Windows Media Player 10 final has been released.

posted on Thursday, June 03, 2004 9:08:46 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Monday, May 31, 2004

I have been having problems connecting for Hotmail these past few days and I have been unable to figure out what caused the problem. I could not get a connection in either Outlook or Internet Explorer, really annoying especially when the girlfriend has no other e-mail account which means she was bugging me about the problem :)

The problem was basically that I was able to log into my Passport but could not get into Hotmail. The connection seemed to stall when the Passport login was complete. The address which the browser would get stuck at was login.passport.com - strange. Even more strange was the fact that other sites displayed without a hitch.

After trying everything from adding the various Hotmail related sites to my secure sites in Internet Settings, deleting cookies, deleting history, deleting temporary Internet files, and troubleshooting my SSL installation I accepted the fact that I was unable to fix the problem and needed a reinstall.

Today I gave the problem another shot before reinstalling, lo and behold everything started working again. The cause of the problem was the MTU size of my router which I had changed in relation to another problem with some wireless networking I had. Changing the MTU size back to the default 1500 (from 1492) resulted in instant connection to Hotmail. How weird is that?!

Oh well, thought I would share this with the world what with routers becoming increasingly popular in households and all. Don't know if the make of the router is important but my router is a Netgear RP614 (let the port attacks commence :)).

All is well that ends well and I am now the official hero in my girlfriend's eyes. Guess I will keep the fact that I was the original cause of the problem to myself :D

posted on Monday, May 31, 2004 3:19:44 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Saturday, May 29, 2004

I can't for the life of me remember where I found this presentation "Overview of the Tablet PC Platform" by Arin Goldberg but it's great both for getting to know what the tablet PC is all about and what the development possibilities are.

I for one am toying with the idea of getting one of these machines as the idea of being able to use a PC in a more natural way what with hand writing recognition and all is very appealing to me. Also being on the cutting of technology counts for something :D Anyway my idea is that I will get more reading done on the computer if I am able to sit comfortly in my livingroom while reading.

posted on Saturday, May 29, 2004 10:02:09 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Some time ago I discovered a neat language feature of VB.NET where you can name parameters for method calls. This is actually something which has been around a long time even before .NET (was there anything before .NET? :) ).

Named parameters is a feature you can use if you want to be really explicit in your method calls it does actually improve readability somewhat.

As an example I had to code a components which would do transactions on people's credit card for Bolia.com because they have way too many transactions each week for them to handle it all manually.

The interface I was programming against looking something like:

 

Function Capture(ByVal sAmount As String, _

                         ByVal sTransact As String, _

                         ByVal sOrderid As String, _

                         ByVal bForce As Boolean, _

                        Optional ByVal sAccount As String = "") As Long

 

You can use named parameters if you want to be really explicit in your method calls it does actually improve readability somewhat. In the case I mentioned I wanted to make it really clear which values were used for what in the method call like this:

 

            Dim amount As String = "11111", transactionId As String = "11111"

Dim orderId As String = "11111", forceCapture As Boolean = True, accountNumber = "1111"

 

Capture(sAmount:=amount, sTransact:=transactionId, sOrderid:=orderId, bForce:=forceCapture, sAccount:=accountNumber)

 

Unfortunately C# does not support this but I guess that it goes against the whole philosophy of C# anyway :)

posted on Saturday, May 29, 2004 9:46:05 PM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback
# Friday, May 28, 2004

I just had to qoute this post from Scott Hanselman where he talks about CodeRush some more. For me the qoute hits the nail right on the head when it comes to the difference between C# and VB.NET.

When folks say that the differences between C# and VB.NET are "syntactic sugar" I like it.  Sure there are a few funky ; % & ^ things in C#, and every once in a while someone will add a new operator to VB.NET like "AndAlsoIsNotOnTuesday" but generally ifs are ifs and fors are fors, eh?

In case you were wondering CodeRush is a tool which helps C# developers be even faster than they are today by adding some features to the VS.NET IDE which the VB.NET developers have had since the inception of the tool but Coderush goes further than this and provides some of the features which are available in Whidbey (Visual Studio 2005).

Unfortunately it comes with a pretty hefty price tag for the at home developer so you better get your boss to pick this up for the office ;)

posted on Friday, May 28, 2004 1:49:57 PM (Romance Daylight Time, UTC+02:00)  #    Comments [2] Trackback
# Thursday, May 27, 2004

Now this is interesting, students at Danish business colleges have been given a case about the IT systems of Bolia.com. I have a special interest in this case as I am currently employed at the company which maintains and develops the systems running the Bolia.com business and spend part of my time writing code for the very systems the students are trying to pick apart.

There are some very interesting discussions around Danish fora where people are trying to find all sorts of weaknesses in the systems and business model.

I almost feel famous right now :)

posted on Thursday, May 27, 2004 1:56:26 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Wednesday, May 26, 2004

I just have to point out this site I discovered this week: The Daily Cup of WTF. It's basically a place where all sort of weirds piece of coding related material get posted. The site is relatively new so there aren't all that many posts as of yet but you'll have a laugh or two from those that are there now that I gurantee :D

I especially like the last post here.

posted on Wednesday, May 26, 2004 10:27:32 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Some time ago Scott Hanselman reported a bug in dasBlog which involved the cache getting corrupted. A hotfix has been released which you should download right away. I have installed this update and as you can see the blog is still running without a hitch :)

posted on Wednesday, May 26, 2004 2:23:07 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Now that Microsoft has announced the successor to Visual Source Safe what will happen to other vendors like SourceGear? Eric Sink of SourceGear answers that question.

posted on Wednesday, May 26, 2004 1:30:44 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Version 0.9.27.68 has seen the light of day. Download it.

posted on Wednesday, May 26, 2004 9:55:40 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Tuesday, May 25, 2004

If you have ever had to design anything in VS.NET you know that at some point when you change from code view to design view or vice versa you will loose the formatting you painstakingly put together with no real way to get it back.

It is something which has annoyed me to no end and know I know why. Read this post at Mikhail Arkhipov's blog if you want to know more. There's even something which looks like a fix although you need to put your coding skills to use in order to make it work.

posted on Tuesday, May 25, 2004 9:54:23 AM (Romance Daylight Time, UTC+02:00)  #    Comments [1] Trackback

We finally have light at the end of the tunnel. Microsoft will release a replacement for Visual Source Safe which has been sourly needed for a long time.

Tons of other stuff than source control is provided by the tool (codenamed Burton) and you can learn more at ActiveWin where there are links for some demo videos or by checking out the product site.

There's even a FAQ available if you have more questions :)

posted on Tuesday, May 25, 2004 9:31:06 AM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback
# Saturday, May 22, 2004

This blog is still relatively new so I am still experimenting with the features of the blogging engine. I have been having some trouble with adding images to my posts so here is a test post with an image of my dog Pepsi - I know the name is weird but he had that name when we got him so there really wasn't anything we could do about it.

posted on Saturday, May 22, 2004 3:03:22 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback

Just saw this post at SecretGeek.net. If you for some reason find yourself doubting your skills or your decisions take a peek at the post. It's really up lifting :)

posted on Saturday, May 22, 2004 2:37:30 PM (Romance Daylight Time, UTC+02:00)  #    Comments [0] Trackback