March 2012 - Digital Tool Factory blog March 2012 - Digital Tool Factory blog

The Digital Tool Factory Blog

Less Accounting Review – a 10 part series – Introduction

I recently signed up with Less Accounting and I will be publishing a Less Accounting review  and experiences with the setup process here

  1. Introduction (this post)
  2. My accounting background
  3. The Signup
  4. Import QB File
  5. Wire Account
  6. Set Recurring
  7. Hook up Bank Account
  8. Hook Up Amex Account
  9. Less Accounting – One Week Later
  10. Less Accounting – One Month Later

FYI – I did totally steal this idea from Shawn Wildermuth’s modern web development series, because I only steal from the best!


31
Mar 12


Written By Steve French

 

How to get a list of the pages Google has indexed on your site

The Problem

'Google Search Coupon: 1 FREE Google Search' photo (c) 2008, Bram Van Damme - license: http://creativecommons.org/licenses/by/2.0/For whatever reason you decide you need to get a list of all of the urls you have on your website.  In my case, I am looking to move a major site to a new platform and the urls will change.  I need a list of all of the pages on the site so I can get a jump on my 301 redirects.  You turn to Google,  specifically Google Webmaster Tools and Google Analytics.  You look around for it forever, but do not find it, even though this is exactly what you think Google Webmaster Tools and Google Analytics should do.  It’s a task you need done, and clearly Google does have a list of all of the urls it has linked on your site.

The Cause

It’s not there.  It should be, but it isn’t.  No idea why they left out that feature.  It would be a vast boon to the world of  internet marketing, search engine optimization and keyword research if they did such a thing, but they do not.

The Solution

You can run a special query, specifically the one listed below which will simply return a paginated list (sadly not in excel spreadsheet form) of every page on your site.

site:digitaltoolfactory.net inurl:digitaltoolfactory.net -.pdf

That’s it!  It’s not the most convenient thing in the world, but it gets the job done.

In the interest of full disclosure, I did not search Bing or Open Site Explorer to look for a list.


30
Mar 12


Written By Steve French

 

How to fix problems with asp.net mvc 3 and jQuery UI AutoComplete

The Problem:

You’re tooling along, using the jQuery library to write some great search feature, and you write some great Linq to Sql code.  Being an awesome coder your use the extension method syntax.  Your action result (in the appropriate controller) looks like this

public ActionResult QuickSearch(string term)
{
var lst = context.Contacts.Select(xx => new {FullName= xx.FirstName +” ” + xx.LastName }).Where(xx => xx.label.ToUpper().Contains(term.ToUpper())).ToList();
return Json(lst,JsonRequestBehavior.AllowGet);
}

And for no good reason, you get no results when you try to search for a contact.  All you get is a blank drop down.  Why has jQuery UI failed you?  Why must javascript code always be so finicky?

The Cause:

For good reason Jquery UI Autocomplete uses JSon for remote data.  It looks for a predefined format, and it wants that name to be called “label”.  It is case sensitive.

The Solution:

Just change your ActionResult to look like this

public ActionResult QuickSearch(string term)
{
var lst = context.Contacts.Select(xx => new {label= xx.FirstName +” ” + xx.LastName }).Where(xx => xx.label.ToUpper().Contains(term.ToUpper())).ToList();
return Json(lst,JsonRequestBehavior.AllowGet);
}

and you will be golden.  Please note I changed FullName to label.  Jquery UI Autocomplete is a very nice and useful tool, but it demands to work on it’s own terms.  Beyond that I have never had a problem with this wonderful bit of ajax goodness.


29
Mar 12


Written By Steve French

 

Southern Crafted Candles joins the internet

Southern Crafted CandlesI have been remiss in welcoming Southern Crafted Candles to the internet world.  I completed the site in December, just in time for the Christmas shopping season.  Handmade in Athens Georgia, these candles pack a powerful pop, and are a needed counterpart to the established and decayed empire of Yankee Candle.

Southern Crafted Candles consists of Candle Guru Zach Kitay and capitalist powerhouse Ben Kitay, working together to create a new and powerful candle company

We built the site in WordPress, using an existing template.  WordPress came through for us again.  One of the downsides of a smooth-running project is that the operation is just not that remarkable, which makes these blog posts difficult to write!

Their candle of the month is a lovely hand crafted  Cinnamon Apple Candle, you should get one today!  Go check it out, we’ll be here when you get back, and your house will smell great too!


28
Mar 12


Written By Steve French

 

Daily Reading – Marketing Funnels, PhotoShop Etiquette, AB Split Testing and Rocksploitation

Just a quick note of some useful links I’ve found on the interwebs.  It makes for some good daily reading.

  1. Engineering your marketing outcomes – The great Patrick  McKenzie talks extensively about online marketing, and how to use modern web technology to enhance your internet marketing results.  It’s not quite gap analysis, but it will take you a long part of the way there.  The sales funnel is essential to your marketing mix and business development efforts.
  2. Photoshop Etiquette – Here is what every developer wishes every designer would do, and what I do (for the most part) when I send my psd files out to be sliced and diced
  3. AB Split testing for asp.net! – I intend to start pushing this in a big way to all of my clients, and this should make it much easier, expect a review of this very soon
  4. Entity Framework Data Migrations – This is one of the very few text tutorials I have seen on the topic.
  5. Useful checklists for your small business brand – From Amy Hoy
  6. The Marketers Guide to Blogging – Neil Patel of QuickSprout does a great job of the why and the high level how of why every business should actively blog.  Nothing earth shattering here, but useful information.
  7. Rocksploitation on St Patrick’s Day! – Just for fun.

22
Mar 12


Written By Steve French

 

How to fix the “Could not read metadata, possibly due to insufficient access rights” error in Sql Server 2008

The Problem

You are doing the responsible thing and make a backup before you make any crazy changes to your Sql Server 2008 database.  You choose the option that gives you the most flexibility and decide to script your backup.  Who knows where this backup will eventually go?

You go through the Tasks>Script Database, and you get the following error

Microsoft.SqlServer.Management.Smo.SmoException: Could not read metadata, possibly due to insufficient access rights. at Microsoft.SqlServer.Management.SqlScriptPublish.GeneratePublishPage.worker_DoWork(Object sender, DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e) at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

The Cause

If I had to guess, I would say that the scripting engine is assuming too much in terms of login.  In any case, just try the option below.

The Solution

Instead of having the “Script Entire Database and Database Objects” radio button checked, instead select “Select specific database options” and just check all three options.  That gives you a large text file containing your database scheme and all of the data that your database contains.


21
Mar 12


Written By Steve French

 

How to fix yet another You must set this property to a non-null value of type ‘Double’ problem with Entity Framework

The Problem

You are coding happily away in Visual Studio 2010, working on your asp.net project, using the entity framework and sql server and you get and you get the following error

The ‘Amount’ property on ‘SomeTable’ could not be set to a ‘Decimal’ value. You must set this property to a non-null value of type ‘Double’.

What you say?  Why do I have to set it to non-nullable? It looks something like

public double? Amount { get; set; }

The Cause

The root problem is in your database schema  – something in how that table is set up is not gibing correctly with entity framework.

The Solution

Just set the property to a non-nullable decimal type, for example

public decimal Amount { get; set; }

It’s not a perfect solution, but Entity Framework does not like all sql server data types, and I have yet to find an explanation as to why or a list of things to avoid.  If anyone does know please leave a link in the comments.  This is a persistent problem for me when working with ourside databases, and I’m sure I’m not the only this happens to.  Your input would be quite helpful here Microsoft.  It would be a nice improvement in the next version of Entity Framework.


13
Mar 12


Written By Steve French

 

How to fix the Entity Framework Code First problem – Model compatibility cannot be checked because the database does not contain model metadata problem

The Problem

So, you are tooling around in asp.net mvc 3 Entity Framework Code First, and you make a change to your underlying model.  you then get the following error when Entity Framework tries to recreate the database in Sql Server or Sql Server Express

Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.

The Cause

You still have some lock on the database in some way, perhaps you still have the database open in Visual Studio (it is very easy to do this in Visual Studio 2010) or perhaps you have it open in a Sql Server Management Studio window.  Perhaps Windows just doesn’t like you.  In any case, it’s that database is open, and Entity Framework Code First will not drop the database if anyone is still using it.

The Solution

You have to release all locks and holds on the database before Entity Framework Code First will drop the database.  To do that, open up Sql Server Management Studio and paste in the following code

USE [master]
GO

/****** Object: Database [MyDBname] Script Date: 02/24/2012 13:54:40 ******/
ALTER DATABASE [MyDBname] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
ALTER DATABASE [MyDBname] SET SINGLE_USER WITH NO_WAIT
DROP DATABASE [MyDBname]
GO

That will isolate your database (please note that “MyDBName” is where you should put your database name) and allow Entity Framework CodeFirst to drop and recreate the database and implement your changes.  Doing this WILL drop the database, so be careful.


06
Mar 12


Written By Steve French

 

How to fix the Entity Framework error “could not be set to a ‘Int16’ value. You must set this property to a non-null value of type ‘Boolean’.”

The Problem

You are writing a lovely Entity Framework web application and all of a sudden you get the following error:

The ‘Status’ property on ‘SomeTable’ could not be set to a ‘Int16’ value. You must set this property to a non-null value of type ‘Boolean’.

You go ahead and set the Status Property type of Boolean and that does not work either.

The Cause

The Data Type on something in one of your models (or business objects as the cool kids would call them) it set to “SmallInt” in the Sql Server database.  There is no direct crossover in C# for it.

The Solution

Explicitly declare that property to be an Int16, which will map it over to a boolean nicely.  You would think Visual Studio 2010 would warn you about such things but it doesn’t.


05
Mar 12


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.