Checking for Constraints in SQL

I had to make some updates in one of to a clients Azure SQL databases, that required me to drop and recreate a table that had a foreign key relationship.  To do this I needed to drop and recreate the FK relationship on a table and I used this script to find all constraints in the the database.

Constraint_Name = C.CONSTRAINT_NAME
) PT

#TampaCC – July 19, 2014

Event Overview

Code Camps are a free, one day learning event for programming professionals and students with a focus on Microsoft Development Technologies. Code Camps are “grass roots” mini application platform developer conferences, free of charge to attendees and open to presenters of all stripes and experience. WinDevCamp follows our simple motto “give a man a fish feed him for a day, teach him to fish feed him for a lifetime”.
Code Camps are

  • By developers for developers
  • Community developed material
  • Teach by coding examples
  • Never occur during working hours

The Tampa Code Camp, a Tampabay based event, is organized by the TampaDev group, Details of the event can be found at Below outlines some of the highlights with regard to contributors.

We have four goals for this event:

  • Provide a first class training experience for our attendees. Even though it will be free, we plan to make it as good as or better than a similar paid event.
  • Provide a great networking experience for Microsoft Development Technology professionals, vendors and employers.
  • Build our speaker pool. We’ve worked hard to get local speakers for the event. Mentorship is being offered for new speakers with assistance to prepare for the event.
  • Build relationships with sponsors. The local user groups are funded entirely by donations and we hope that you will them as a good venue for highlighting your products, services or just as a good place to look for Microsoft Development Technology talent.

To register for the event you can RSVP here.

Better Battery Usage with Windows Phone 8

Randy Patterson and I were discussing battery usage on the Windows Phone 8 (he has an HTC 8X and I have a Nokia 822), and he was struggling with poor battery usage. I asked if he had taken the time to manage his application background tasks, to which he stated “What do you mean?”. I took a few minutes to show him how to do it and he comment was “you should blog about this, I had no clue you could do this”. So, here we are and I would like to thank Randy for the blog idea.

To get started go into your “Settings” on your Windows Phone 8, once there swipe from right to left to get to the “applications” screen, then tap background tasks. You will see a list of applications the have a background task, and my rule of thumb is, if it does not have regular or wide tile on my start screen or the live tile data I don’t really care about then I block it to save battery time. Now you may ask “how do I block an application?”, as you can see below it is fairly painless to do – one in background task simply tap the app then tap block.

wp_ss_20130508_0001 wp_ss_20130508_0002 wp_ss_20130508_0003

Let’s take a quick look at my battery usage to see how I have things performing.  As you can see below I have almost 3 days of usage from a single charge.


Now as a side note, if your mail supports push technologies like Office 365 or Outlook you don’t need to worry about the next comment.  if you use pop, you should set your POP email to check every 30 minutes to an hour, this will help increase your battery time as well.

Well I hope these suggestions help you, if you would like to know more please let me know.

Second INETA Component Code Challenge 2012

For the second time this year I have the great opportunity to be one of the judges for the INETA Component Code Challenge.  Here are the details:

Have you ever thought “I have a good idea for an application, however what can I get for it?” and/or “I would love to go to DevConnections, but I am not sure how to pay for it?”. Well, you are in luck. With the INETA Component Code Challenge for 2012, all you need to do is create an application using 2 approved controls from 2 approved vendors, create a video talking about your application, and submit it to our judging panel. Our judging panel, consisting of Bill Reiss, Nikita Polyakov, Matt Hidinger, and Greg Leonardo, will be looking for innovation and creativity in the use of approved controls. To read official rules click here.

So grab your computer and Visual Studio and GET YOUR CODE ON!

Disclaimer: INETA covers one conference ticket, hotel, and travel to the conference as is outlined in INETA’s travel policy. Please visit the site for additional rules.

ASP.NET Universal Providers, a tale of new providers in MVC4

The ASP.NET Universal Provide cover Membership, Roles, Profile, and Session solutions in MVC4 which can leverage SQL Compact, SQL Express, SQL Azure, and SQL Server.  The biggest deviation from old ASP.NET 2.0 Membership is the need to run aspnet_regsql.exe to install the database side before you are able to use them.  ASP.NET Universal Providers now provide the magic to setup the persistence store with simply providing the database connection string.


If you would like to install the Universal Providers, because you did not select Internet based project in the MVC4 project selection screen.  You can run the Package Manager to install but doing the following:

Package Manager Console in menu

And entering “Install-Package System.Web.Providers” at the PM> prompt.

Quick look at security in MVC3

I learned about some security features in MVC3, that I had forgotten about.  So, let’s discuss them and the differences between authenticate and authorization as well as look at some standard attacks.  MVC3 out of the box supports Windows and Forms based authentication, Windows authentication are generally used for intranet applications and Forms based is general used for internet based applications.  With forms authenticate SSL needs to used to help protect the username and password being entered by the user.

To secure a controller action you can use the [Authorize]  attribute to secure an action or the controller itself.  If you use just the [Authorize] attribute, all you are really saying is you don’t want anonymous users to access the controller or action.  You can further define this by adding Roles or Users to the [Authorize] attribute, which is the authorization part of security in MVC3.

Now let’s talk about site attacks.

Cross-Site Scripting, which are defined as cookie theft, malware downloads, account hijacking, and modify content to name a few.  This is controlled by the underlying framework, however you can use [AllowHtml] attribute to the model property you would like to allow Html to flow through with minimal risk.

The Anti Cross Script library can be used to help sanitize the Html.

Cross site request forgery can be combated with the @Html.AntiForgeryToken() on your form declaration and ValidateAntiForgeryToken attribute on the post destination action in the controller.

In the View form definition.

[sourcecode langauge=”csharp”]
@using (Html.BeginForm("Contact", "Home")) {

In the Controller Action

[sourcecode langauge=”csharp”]
[OutputCache(NoStore=true, Duration=0)]
public ActionResult Contact(string message = null)
EmailModel email = new EmailModel();
ViewBag.Message = message;
return View(email);

Hopefully this give some insight into security options with MVC3, I will follow this up with MVC4 here soon.