Categories
Uncategorized

Syncing Visual Studio Database Project With Entity Framework

Or: Quirks of Using Entity Designer Database Generation Power Pack

If you’re searching for a way to synchronise a “Visual Studio Database Project” (also known as “SQL Server Database Project” or “TSData Project”) with an Entity Framework model, you’ve probably already encountered the “Entity Designer Database Generation Power Pack”.

With model first development, the most basic use case is to synchronise the database project with the model. If you are trying to achieve this, you need to be aware of conventions that have been baked into the tool:

  1. Your “.edmx” file must have the same name as the “.dbproj” (i.e. database project name).
    • It is just the file name of the model that is important.
    • Neither the “Namespace” or “Entity Container Name” properties of the model need to match the file name. In fact, you will not be able to use names containing full-stops/periods (“.”) in these properties, but you may well require that for the file name if you’ve named your database project in this fashion.
    • It is just the file name of the database project that is important too. The name of the
  2. Your database project must lie in the root of the solution structure. i.e. do not put your database project in a solution folder.

Footnote

There won’t be any more development of the “Entity Designer Database Generation Power Pack”, as the functionality is being provided as part of the “SQL Server Developer Tools”, code named Juneau. This would be the better toolset to use to satisfy this use case.

Categories
Uncategorized

Internet Explorer 6 – Dying Days?

IE 6 was once the most popular browser on the market. This despite its lack of adherence to standards and its poor rendering performance. These days it’s on the way out, and no-one in IT is mourning it. The graph here shows the trend of IE 6’s market share over the last year and a half (source: http://www.w3counter.com/globalstats.php).

The story’s not that simple though. Corporations still persist in forcing their employees to use the browser, doubling its share during working hours, and Microsoft have still committed to supporting it for some years yet. Problems with an attack on Google via IE6 security flaws in December 2009 don’t seem to have galvanised companies into ditching it, but maybe Google’s subsequent withdrawal of support for IE 6 in GMail and other Google Apps “later in 2010” will accelerate this.

Categories
Uncategorized

ASP.NET HTTP 400 Bad Request Exception

Someone on my project pointed me at this useful article from Alois Kraus about the 400 “Bad Request” exception coming from ASP.NET. In particular, it cleared up the way that length checking is performed on a URL in an incoming request.

On my project we are relying on a key from FAST ImPulse, a search engine for eCommerce apps. This key is included in a URL. In certain deep search scenarios, e.g. lots of filtering on facets of a product, this key can become very long. This has been resulting in the “Bad Request” messages. It turns out that there is a difference between including this key in the path of the URL and as a query string parameter. For example:

http://www.example.com/{key}/results.aspx

http://www.example.com/results.aspx?key={key}

If {key} is close to 260 characters, the first URL will be rejected by ASP.NET whereas the second will be accepted. ASP.NET only allows the path part of the URL to reach 260 characters. As the article mentions, ASP.NET 4 allows this limit to be changed.

Categories
Uncategorized

Setting up a keyboard shortcut for View History in Visual Studio using TFS

Note – this post refers to and is tested with Visual Studio Team System 2008.

If you’re using Visual Studio and Team Foundation Server, you’ll probably be viewing the history of files in your solution fairly regularly. Unfortunately there’s no keyboard shortcut set up for that. If you wish to set one up, here’s what to do:

  1. Go to the “Tools” menu and select “Options” and then “Keyboard”
  2. In "Show commands containing:” type “TfsHistory” and select “File.TfsHistory” in the list.
  3. In “Press shortcut keys”, put in your desired shortcut. Take a note of anything appearing in “Shortcut currently used by” to ensure you don’t overwrite anything.
  4. Click “Assign”

In the screenshot below, I’m setting up “Ctrl+Shift+Alt+V” followed by “H” to be the short cut. Once I click “Assign”, I’m done.

Categories
Uncategorized

Love Clean Streets

I hate seeing (bad) graffiti or fly tipping anywhere, but especially around our own neighbourhood. I keep thinking I should get the council to do something about it with all that council tax I pay, but it has always seemed a bit too much of a hassle to get around to doing it.

Now there’s an easy way to let councils know, and that’s via an organisation called “Love Clean Streets”. They provide an iPhone app and a Windows Marketplace app of the same name. The app will prompt you to take a picture and enter some brief text about the issue. It will then tag it with your account (Twitter/Facebook/Windows Live/etc.) and the GPS co-ordinates from your phone.

The result is a public online database of environmental issues filed by local authority and ward. Some councils have signed up to provide updates on issues and let the site know when they have been rectified. Those councils that don’t currently do so, like mine (Merton), may soon bow to pressure once the database builds up.

Categories
Uncategorized

Arthur At Six Months

It’s late August and Arthur’s six months old, eating messy ‘solids’ and has had one lot of surgery on his lip. He’s doing well, putting on a quarter of a kilo last week. Let’s hope that rate of growth slows somewhat, eventually! He’s pictured on the right here with Lion, a genuine native Namibian, who chose to travel back to the UK with Arthur’s Grandpa Dave (Julie’s dad). On the left, below, he’s being bewildered by my brother Nathan on his cousin Florence’s play mat.

As I mentioned, Arthur has had one operation so far. This was to ‘pin’ the sides of his lips up to the middle part of his lip, and to start pulling that middle part back a little. It is preparatory surgery for his second operation, which has recently been retimed to mid October. The second operation will be more of a cosmetic one with the aim of connecting the lip muscles rather than just the skin. Once everything has calmed down, this should go some way towards looking like a ‘normal’ lip.

Further operations will be required to close the gap in his palate and possibly to pull back the gum and bone that sit behind the middle lip. The former should take place near his first birthday, as this will be necessary for speech development.  The latter will probably happen just before school age, so I reckon he’ll be a bit goofy with his milk teeth until then!

All of this is being done on the NHS, whose South Thames Cleft Services have given us some excellent support. In other countries kids aren’t quite so lucky. You’ve probably seen the adverts for SmileTrain, a charity facilitating cleft repairs for those in countries without the facilities we get from the NHS.

Anyway, tonight sees him move out of our room and into his own bedroom, into the cot bed that could be his bed for the next four and a half years! Hopefully he’ll take to it well. We’ll see!

Categories
Uncategorized

Refreshing the Internet

I have just had a call with IceSave, with whom I have opened a new savings account. I have been consistently unable to log in and so wanted to work through the error. The nice girl on the phone confidently told me that all she needed to do was ‘refresh the internet’ for me and it would work tomorrow.

Technology’s amazing.

Update 7th Feb: Incredible. It works. Next time you’re suffering login problems, I suggest you try refreshing the internet. It worked for me.

Categories
Uncategorized

Desired Improvements in Business Intelligence Developer Studio

I’m going to focus on some aspects Calculations in Analysis Services cubes here, and perhaps follow up with more areas later.

1) I’ve already mentioned the strange location for setting the Display Folder property of Calculations in another post, but it deserves inclusion here. Additionally, why is it not possible to set other properties such as Description? Why can we not use the standard Properties window in the shell for all these? Why are Format String, Visible and Non Empty Behavior (sic) on the made expression editing page. (Actually it’s because the Display Folder is in the <Calculation Properties> element and the latter form part of the MdxScript, but this is not a good reason for the UI to split them up.)

2) Intellisense in the Expression box, and real time evaluation of member names. The real time Expression validation in the calculations only deals with basic MDX syntax. I would like a background thread to check member names as well. I accept that it would be difficult to differentiate between the intent to reference a data driven member versus something like a measure name that is baked into the schema. However, it would be useful to at least have mis-spelled measure names underlined. Errors in these are only caught when the calculation is first queried.

3) The Metadata pane in the Calculations tab does not show calculations that have a Visible property of false. This is pretty irritating when you try to drag and drop invisible calculations into the Expression box. It encourages error prone re-typing.

4) The "Calculation Properties" window is too narrow on opening. With reasonable sized calculation names with common prefixes it’s impossible to tell them apart due to the short column width.

5) Comments in calculation expressions cannot be placed at the top of the calculation. If you switch to script view and back to form view they will no longer be visible (but they are still available in the script). They work if placed at the bottom.

 

Categories
Uncategorized

Principle Engineer [sic]

Lately I stumbled upon an email signature in which the author had entitled their job "Principle Engineer". As it has never been explicitly clarified, I suspect this is a homonym of the intended adjective. That is, unless his job was to maintain the moral upstanding of the company.

Of course, a "Principal Engineer" ought to be the first in order of importance [Cambridge Dictionaries Online], which is also not true as there are, possibly, hundreds of employees in his company with this designation.

Categories
Uncategorized

Caution! Hot Taps!

The office I’m working in has a notice above each sink:

"Caution! Beware of hot taps. The hot taps have been pasteurised and all water outlets will be very hot."

Surely it is the water that has been pasteurised, not the taps?