When you buy this book you support this site! - Thank You for your support!

Sep 5

Written by: Michael Washington
9/5/2011 9:36 AM  RssIcon

image

The LightSwitchHelpWebsite.com now has multiple bloggers. I realized that the Tags menu is really the only way for people to find past Blogs.

image

The Tags that I created when I was the only blogger seem inadequate now, and I wanted to add new Tags and reassign Tags for existing Blog entries.

My goal is to do this in a way that is fast and easy. Keep in mind that while the LightSwitchHelpWebsite.com is focused on showing how you can use LightSwitch for full enterprise applications, LightSwitch was primarily designed to be used in the manner described in this article.

 

Create The Application

image

The first step is to create a LightSwitch application.

 

image

In the Solution Explorer, right-click on the Data Sources folder, and select Add Data Source.

 

image

Select Database.

 

image

Enter connection information and click OK.

 

image

image

Select the tables related to Blog Tags.

 

image

The Entities (tables) will show up in the Solution Explorer.

Right-click on Screens and select Add Screen.

 

image

Select the List and Details Screen template and the Blog_Entries table for Screen Data.

LightSwitch is able to see the foreign key relationships between the tables, and allow you to include the related tables.

In this case we only want to add the Blog_Entry_Tags table.

 

image

The screen will show in the designer, and the only change we will want to make is to remove the Entry Tag ID field because it is a auto number field that we cannot edit anyway.

 

Run The Application

image

We hit F5 to run the application.

 

image

We now have an application that allows us to select a Blog entry on the left-hand side of the screen, and edit its tags on the right.

Notice that LightSwitch automatically created a drop down of all the possible Tags. It is showing us the Tag name but correctly saving the Tag  id in the database.

All of this is customizable, but LightSwitch automatically tries to figure things out for you.

 

image

image

We can also make a screen that would allow us to create new Tags.

 

Integrating DotNetNuke and LightSwitch

You can easily integrate any LightSwitch application inside your DotNetNuke website:

Easy DotNetNuke LightSwitch Deployment

DotNetNuke Things For Sale

Tags: DotNetNuke
Categories:

3 comment(s) so far...


Gravatar

Re: Quick And Easy Data Management With LightSwitch

Great article!

Can I suggest that you implement a "level" feature on the site, so that it's easy to see which articles are for beginners, which for intermediate and which for experts. This would make it much easier for people to filter the new articles into those that are likely to be of interest to them.

Also, a small typo in this article where (just after the shot of the final application), you say "and edit it’s tags..." - the apostrophe should not be there! Not a major point, but you might as well get it right :)

Thanks again, and keep up the good work!

By Yossu on   9/6/2011 6:19 AM
Gravatar

Re: Quick And Easy Data Management With LightSwitch

Wow, another great post mate!
This truly demonstrates the true power of LightSwitch!
Keep it up!

By Jan Van der Haegen on   9/6/2011 3:26 PM
Gravatar

Re: Quick And Easy Data Management With LightSwitch

@Yossu - There is a Beginner and Advanced Tag, but perhaps I need to move some stuff around. I fixed the its :)

By Michael Washington on   9/6/2011 4:00 PM

Your name:
Gravatar Preview
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment   Cancel 
Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation