September 2010 « Digital Tool Factory blog

The Digital Tool Factory Blog

How to fix the “could not load file or assembly microsoft.sqlserver.batchparser” error

database schemaThe Problem: Every time you attempt to run Microsoft’s excellent Database Publishing Wizard Utility you get the following error after you enter your login information could not load file or assembly microsoft.sqlserver.batchparser

The Cause: This problem can be taken literally – Microsoft.SqlServer.Batchparser is not installed on your computer.

The Solution: Go To this link on the Microsoft site and download the Microsoft SQL Server 2005 Management Objects Collection. Then install the MSI

That’s it!

For those of you who are not familiar with the tool, the Database Publishing Wizard is a free tool Microsoft made which allows you to generate sql scripts of existing databases, which speeds up moving them around on third party hosting better than any other method.

Creative Commons License photo credit: gnizr

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


30
Sep 10


Written By Steve French

 

Exploring the long tail topics of my personal knowledge

Stop and ThinkOne lesson I learned (not from anything specifically said, purely a deduction) from this excellent Mixergy interview with Brian Crane of LuckyGunner.com is to NOT weave  small thoughts into the big picture, but to instead let them be small thoughts. Apparently LuckyGunner.com succeeds by chasing the long tail.  Therefore I am going to keep the “How To Fix” and “Code Sample” series, but keep  the meta blogging about business and network theory to a minimum.

Now that I see all this written out I have the thought that I should finalize the public Stronico sites.  I had tentatively scheduled public sites for about six months from now, but perhaps they should be moved up.  The public sites would be public accessible, read only Stronico accounts,  viewable to all but only updatable by administrators, sort of the wikipedia of social network diagrams.  The first few would be based on either my particular local knowledge or publicly available knowledge.  The first few public sites would:

  • The current Atlanta independent music scene, defined as bands, bookers, clubs, musicians etc and the like.   (present day and adaptable)
  • The East Atlanta small business community, and by East Atlanta I mean more than the Village.  I am defining East Atlanta as East Atlanta (the neighborhood), Ormewood Park, Grant Park, Woodland Heights, and Rebel Forest.
  • The Atlanta Woodworking Community – both craftsmen and vendors
  • The Atlanta Guitar community, i.e.  people who buy, sell, and treasure find musical instruments (defined as those costing over $2,000)
  • The Atlanta graphic design community, both firms and designers
  • The Atlanta Microsoft ecosystem, players, institutions, and firms.
  • The American used Sterling Silver Market,  including merchants, manufactures, wholesalers and museums.
  • The Metro Atlanta convention industry

Should any of these sites get any amount of traffic they could be sponsored by an industry leader like Stomp and Stammer or the Metro Atlanta Chamber of Commerce.

I realize that this blog post is a poorly written answer to a question that no one asked, that’s most of the internet when you think about it

Creative Commons Licensephoto credit: DWRose

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


30
Sep 10


Written By Steve French

 

How to fix problems with the placeholder control and custom web user controls

The Problem: You are using an asp.net PlaceHolder control and populating it with a collection of custom web controls.  You then get “Null Reference Exception” and “Are you missing an assembly?” errors.  Your code looks much like this

foreach (string str in strStringList)
{
CustomWebBox cb=new CustomWebBox()[
cb.CustomTitle=str;
myPlaceHolder.Controls.Add(cb);
}

The Cause: The same ID’s are being used over and over agian in the page as the web control repeats.

The Solution: Instead of simply reinitializing the control the “new” keyword, load it manually using Page.LoadControl.  That keeps the id tags different and the error is avoided.  Your code would look something like this.

foreach (string str in strStringList)
{
CustomWebBox cb=(CustomWebBox)Page.LoadControl("~/CustomWebBox.ascx");
cb.CustomTitle=str;
myPlaceHolder.Controls.Add(cb);
}

That’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


27
Sep 10


Written By Steve French

 

Instead of my original thoughts, here are other peoples

Rather, here are some things I’ve been reading

  1. MyType study: iPad owners are ‘selfish elites’
  2. The real money in Farmville
  3. Windows Phone 7 Dev tools are released
  4. Child Up is going through John Medina’s bookBrain Rules For Baby, which does not seem to be coming out on the Kindle.
  5. Media Warning Labels

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


23
Sep 10


Written By Steve French

 

How to Truncate a Table in Sql Server

I hadn’t used this handy tool in sql server in a while and actually had to look it up recently, so here it is in the code review.

TRUNCATE TABLE “table_name”

Truncating not only deletes all of rows in the table, but it deletes all information about the table, which makes all auto numbering integer fields start over at 1.  Not complicated, but surprisingly few people know about it.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


15
Sep 10


Written By Steve French

 

The List in C#

The first entry in my Code Review is the List<>.

So far, the List is my favorite sort of array in C#.  It has the benefits of

  • being obvious in naming
  • you do not have to know the size when it is declared – the List can expand or contract as needed
  • adding items to the array is quite simple, as is looping through the array
  • finding items in the list is easy as well

The basic List syntax is this

List<string> lstContactList = new List<string>();

At first the syntax looks a bit off, what with the odd angle brackets<> and the () at the very end of the declaration, but that is the only counter-intuitive part of the List.  Please note, a list can hold any type of object or type, not just strings.

To add to the list simply use the .Add syntax, for example

lstContactList.Add (“Bob Raindorf”);.

You can find the index of a particular list item by simply using this syntax:

lstContactList.IndexOf(“Bob Raindorf”);

Once you identify the  identified, you can replace the value of the list item quite simply by

lstContactList[lstContactList.IndexOf("Bob Raindorf")] = “Robert Raindorf”;

If you want to loop through the list, just do this

foreach (string str in lstContactList)
{
InsertToDB(str);
}

To clear the list, just do this

lstContactList.Clear();

That’s all I need to remember (for now anyway), hopefully the act of writing this pushed it into long term memory.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Sep 10


Written By Steve French

 

Introducing the new Code Review Category

WorkmodeOne of the lessons I learned from John Medina’s excellent book Brian Rules is that of elaborative rehearsal, which is (roughly) defined as remembering something more strongly by doing something with the new information, like giving a book report or relating that information back into something you already know.   Example: Say you already know the geography of Central Asia, if you wanted to remember the story of Genghis Khan, you could relate Genghis’ story to the already known geography, and then giving an oral report on old Genghis.

Like most coders, I sometimes forget code syntax of functions I don’t use that often.  I am now going to start writing up short expositions on the functions I have to look up in the hope that writing up the exposition will help transfer the function into long term memory.

photo credit: akaalias
Creative Commons License

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


07
Sep 10


Written By Steve French

 



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