Monday, 21 July 2008

System.Web.Query.Dynamic.ParseException: Digit expected

Today I wrote a quick piece of code using Linq to Sql that would pull out some records from a table given a provided where clause
To make my life easy, I used a LinqDataSource within a web form and then databound a form view to it, this was only a quick prototype of an idea so I felt these were appropriate.


The where clause for my LinqDataSource was being assigned programatically and consisted of a GUID value from a user object I had knocked together. Upon compiling and running the code though I got an odd error: System.Web.Query.Dynamic.ParseException: Digit expected


First thing to check was that the value I was giving the where clause was actually an GUID value, debugging showed this fine, I next looked at putting a hard coded GUID where clause in to see if it was some weirdness caused by my user object, but this wasn't the case. I finally googled the error message, and found 1 meesly result which pointed to the MSDN forums.


Here someone posted that you can convert to various types and to try explicitly converting to a GUID value


   lds.Where = string.Format("user_id == Guid({0})", user_id);

This worked fine, and it made sense too, as when you declare where parameters on the linqdatasource control you normally define its type, as I wasn't doing this nor programtically it was type casting by itself.

Monday, 14 July 2008

Build failed due to validation errors in. dbml

OK so I got in today to find that I was unable to build my current project, I got the following

Error 1 Build failed due to validation errors in C:\xxx\DB.dbml. Open the file and resolve the issues in the Error List, then try rebuilding the project. C:\xxx\DB.dbml 2

I opened the projects dbml files to find that these files were fine, no errors or typos, the project was just dead. a little bit of Googling lead me to find that its a problem with Visual Studio 2008 not loading an assembly correctly, in particular the one with a GUID of 8D8529D3-625D-4496-8354-3DAD630ECC1B

In order to load the assembly correctly you need to get Visual Studio to reset it's packages, to do this:

  1. Open a new command prompt
  2. Navigate to C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
  3. Run Visual Sudio with the /resetskippkgs argument: devenv /resetskippkgs

You should now find that your project opens and builds correctly! I'm hoping that maybe SP1 of Visual Studio will correct this, if not SP2 maybe...

Update: SP1 Didn't fix this :( Also worth noting if you are running a 64 bit OS then the visual studio folder path is C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

Thursday, 26 June 2008

Loosing the Address Bar

Microsoft Windows has had the "address bar" for a long time. Although not used by many adding it to your taskbar for some has provided an amazing way of quickly getting to files, folders and web addresses.


I have used it for a while and have it in the bottom row of my task bar, I have this setup at home on my machine, work and until recently Hayleys Laptop.


SP3 came out recently and I immediately updated Hayleys laptop to it, all seemed fine, however today I logged into as me, and noticed the address bar had "vanished". First of all I thought I has just knocked it off but no it had physically disapeared from the toolbar list.


A quick Google later left me speachless....


"After installing Windows XP Service Pack 3, the Address Bar feature will be removed from the Taskbar. The Address Bar feature will not be present in Windows XP Service Pack 3. This change is in response to a regulatory request and is present beginning with Windows XP Service Pack 3 Beta."

It has been removed! The reason behind this is that the Addres Bar is actually part of IE, and Microsoft are trying to make IE less dominant within Windows due to antitrust. I personally think this is a joke, if the address bar opens links up in your preffered browser, in my case Firefox, does it matter that it's an IE component that fires up FireFox??


After further browsing I have found an Addon some one has wrote MuvEnum Address Bar to help with the issue but as of yet I havn't tried it due to now wanting to put something else on Hayleys Laptop.


To remove such an established feature is a real low blow, and I'm sure there must be a better solution, even if it involved more work.... So I was left without my address bar on Hayleys Laptop and hoping that work doesn't upgrade to SP3 anytime soon. Interestingly SP1 Vista still has the address bar so I wonder if SP2 will remove it.