Lightswitch – Query where no match exists in reference table

I’m building an internal IT inventory application in LightSwitch, and have been trying to add a screen that only shows software in the inventory that has not been assigned to hardware.

Lightswitch doesn’t allow the graphical query editor to select the “many” side of a relationship on a filter (as documented here), so this is something that must be done in code.

I struggled for a bit trying to make a Left Outer Join in Linq between my two entities, but eventually stumbled upon a post by the always helpful Yann Duran:

http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/664454f7-0b2e-409e-b57c-625180132c53/

What I needed was the C# syntax for his suggestion, which is reproduced here with my relevant entity name:

query = query.Where((a) => a.itinv_SoftwareAssignedHardwares.Any() == false);

This is created within a query on the itinv_Software entity.

 

Mourning the loss of Dekiwiki

In 2007 I implemented Mindtouch Dekiwiki as an internal website. I was excited by the quality of the product, the extensibility, and most importantly the active community and developer interaction.

As Mindtouch grew, they incorporated more excellent features, and were very open about the direction of the product. The developer site contained a wealth of information about release schedules, change logs and tutorials for the product. I found myself interacting with the community regularly, posting information on how to do certain things, answering questions on the forums and filing bugs. I was encouraged that employees of Mindtouch were directly interacting with the community on a daily basis.

I don’t think the company that produced that product exists any longer. It’s been replaced by a buzzword-spewing, no-face entity who hides real information about their product behind flowery text and email signup forms. I lose a lot of interest when companies make it difficult to gather information about their product, and If you take a look at mindtouch.com you’ll find they’re one of the worst offenders. There is only a single line or two on the main page describing what the company is all about, and the product page itself is still undergoing an identity crisis with names such as Mindtouch TCS, Social Help System and just plain Mindtouch in most of the descriptions.

There is actually very little information about the product, no demo site or feature comparisions, no cost information or even licensing models. What videos there are, are hidden behind email sign-ups. As a company marketing it’s product, if you feel the need to hide what you’ve built behind a sign-up wall, you immediately make everyone who comes across it distrustful. Are they not confident enough to proudly show it off? Are they worried that the licensing model will scare people away?

The developer site is effectively dead, and so is Mindtouch Core, the open source edition of what once was Deki Wiki. Most frustrating of all is that Mindtouch Core (the open source derivative of Mindtouch) is no where to be found. Its basically impossible to find it now, which is sad considering that I remember the owners and developers passionate exclamations a few years ago that the product started as open source, would always remain open source and that it’s community would always be vital.

To be clear, I can’t really blame the leaders of Mindtouch for moving in this direction. One look at their customer list and you can see it’s a profitable transition. However I can’t help but be disappointed and a little bit betrayed. To see the excitement of the developers and of the users who are adding to the product is one thing that makes it very attractive. It tells me that the product is good enough to make people talk about it and invest time into it.

Dekiwiki, I’ll remember you fondly as I go looking for your replacement.

 

 

Lightswitch Deployment for 3-tier app

I’ve been having a problem trying to deploy my first Lightswitch app to IIS, where the first Application Administrator isn’t being created.

I kept getting an error similar to “unable to create the application administrator”.

Google eventually brought me to look at the MSDTC settings on the IIS server, but that definitely wasn’t the right direction.

However, I did find the following thread which provided the solution:

http://social.msdn.microsoft.com/Forums/hu/lightswitch/thread/615aaa1b-4f37-40a1-ace2-0735c294c57e

I set “enlist = false” within the web.config application string for my database connection, and this resolved the issue!

 

I’m still impressed by LightSwitch, although I’ve been finding myself wishing it was easier to use custom SQL queries when building the datasets.

PowerEdge R410 – PERC S300 and Server 2012

I encountered an epic planning fail on my part this morning. During the annual Christmas Maintenance that I perform, I decided to upgrade my Hyper-V cluster to Server 2012, since I have the Datacenter licenses and want to use some of the features.

So I took my time and prepared the upgrade, documenting every step I would take so that things go smoothly.

When I began the process, I booted into the Server 2012 media, loaded the PERC S300 drivers from Dell (Server 2008 R2 should work right?) and got a blue screen.

I did some quick digging, and the S300 is not supported for Server 2012, and never will be.

I can’t believe that I didn’t think to check my RAID card for compatibility before embarking upon this. At this point I don’t want to run my Hyper-V host without RAID (by converting the S300 into a regular SATA controller) so I’ll look at the PERC H200 or H700 from my Dell rep.

 

Why is it that with all the preparations made, there’s always something forgotten?

 

Set default value for lookup parameter in Lightswitch

I’ve begun developing an IT Inventory project within Visual Studio Lightswitch, both for use and to learn the product so that I can use it on a new line-of-business application for my company.
While working through this, I came across the need to set a default value for a parameter and I struggled for a long time to find the answer.

 

Luckily there are great resources like Stackoverflow, which has given me an answer in less than 24 hours!

My full question (and the answer) can be found here: http://stackoverflow.com/questions/13710308/set-default-value-for-parameter-in-lightswitch but below is a little background on what I’m trying to do.

 

There are multiple “Companies” to which our assets can be assigned, but 90% of the assets belong to CompanyA. When opening my default screen that displays the list of inventory items, I want it to default to CompanyA, with an option to change it afterwards.

So I’ve created a Query on my data source, assigned a parameter, and then added the proper data objects within the screen to provide the filter. It was trying to set a default for that parameter which was causing me problems.

 

I’m actually quite impressed by LightSwitch; it has enabled me to build this Inventory application in less than a week’s worth of time. There have been some quirks to work around, and you’ll want to be sure that you have a final decision on what type of data source you’re using (SQL vs RIA Service in my case) before proceeding with lots of work since you can’t change the screen’s data source later.

I bring this up because I started using two SQL data sources which are separate databases but have a join. LightSwitch makes this a ‘virtual join’ and thus doesn’t allow you to make queries and filters on the second data source. I’ve since converted to a RIA Service and am now redeveloping the application.