Wednesday, October 9, 2013

Object reference not set to an instance of an object when using HTMLEditorExtender

Question: While working on an AJAX-enabled application, I got "Object reference not set to an instance of an object when using HTMLEditorExtender". How do I fix this?



Answer: Add a register page directive referencing the AjaxControlToolKit. This is in addition to the steps mentioned at http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx

Sunday, July 7, 2013

July 2013 Local and Regional Events

Local Events
7/2: ON SQL User Group (www.ohionorthsqlserverug.org)
7/9: Cleveland .NET User Group (www.bennettadelson.com/ComingEvents.aspx)
7/16: Cleveland WPF User Group (www.ClevelandWPF.info)
7/17: Hudson Software Craftsmanship Group (hudsonsc.com)
7/23: Cleveland C#/VB.Net User Group (www.clevelanddotnet.info)
7/24: Cleveland SharePoint User’s Group (www.sharepointCleveland.com)


Regional Events
7/12-13: Codestock – Knoxville, TN (http://codestock.org)
7/19-21: Cleveland GiveCamp – Cleveland, OH (http://clevelandgivecamp.org/)
8/12-14: That Conference-Wisonsin Dells, WI (http://www.thatconference.com/)
8/28-30: DevLink - Chattanooga, TN (http://www.devlink.net)
8/30: CloudDevelop – Columbus, OH (http://www.clouddevelop.org/)
9/15: SQL Saturday – Pittsburgh, PA (http://www.sqlsaturday.com/250/eventhome.aspx)

Friday, May 31, 2013

June 2013 Local and Regional Events

Local Events
6/4: ON SQL User Group (www.ohionorthsqlserverug.org)
6/11: Cleveland .NET User Group (ww.bennettadelson.com/ComingEvents.aspx)
6/14: CLE SharePoint Golf Outing: (http://clesharepointgolfouting.eventbrite.com/#)
6/15: Web SIG: Intro to HTML5 (http://www.gcpcug.org/websig)
6/18: Cleveland WPF User Group (www.ClevelandWPF.info)
6/19: Hudson Software Craftsmanship (hudsonsc.com)
6/25: Cleveland C#/VB.Net User Group (www.clevelanddotnet.info)
6/26: SharePoint User’s Group (www.sharepointCleveland.com)


Regional Events
6/1: Pittsburgh Tech Fest (http://pghtechfest.com/)
6/8: SQL Saturday – Columbus (http://www.sqlsaturday.com/217/eventhome.aspx)
7/12-13: Codestock – Knoxville, TN (http://codestock.org)
8/12-14: That Conference - Wisonsin Dells, WI (http://www.thatconference.com/)
8/28-30: DevLink - Chattanooga, TN (http://www.devlink.net)

Friday, April 26, 2013

SQL Server Collation

Question: I was putting together a small bit of SQL code the other day, and I was running into a bug. While debugging it, I was completely shocked to discover:

IF 'a' < 'A'
SELECT 'a < A'

IF 'a' = 'A'
SELECT 'a = A'

IF 'a' > 'A'
SELECT 'a > A'

IF 'a' <> 'A'
SELECT 'a <> A'

displays only 'a = A'.

I investigated and found out that the reason for this result is that the database's collation sequence is set to one of the "CI" values (Case Insensitive). I took a look at a couple of other databases, and they were also "CI". Oddly enough, they were slightly different collation sequence values, but definitely "CI". This includes the [master] database.

Yes, I know it could have been configured the other way. That's not the point of this note. Is "CI" the expected standard configuration?

In addition to the crazy logic implications, I've got to believe that it's at least a bit slower to execute, since all text-based columns needs to be compared in a case-insensitive way. That character set translation can't come for free.


Answer:
The collation setting is specified during the installation of SQL Server. As seen in Figure 1, the default settings used during the installation of SQL Server 2012 are:

Database Engine: SQL_Latin1_General_CP1_CI_AS
Analysis Services: Latin1_General_CI_AS


Figure 1: SQL Server 2012 Default Collation Settings

Technically, there is no "expected CI standard". It all depends on the collation setting of the database. This is not to say you're stuck with that setting forever. If you visit http://msdn.microsoft.com/en-us/library/ms143726.aspx, you will see the following excerpt:

Setting collations are supported at the following levels of an instance of SQL Server:
Server-level collations
The default server collation is set during SQL Server setup, and also becomes the default collation of the system databases and all user databases. Note that Unicode-only collations cannot be selected during SQL Server setup because they are not supported as server-level collations. After a collation has been assigned to the server, you cannot change the collation except by exporting all database objects and data, rebuilding the master database, and importing all database objects and data. Instead of changing the default collation of an instance of SQL Server, you can specify the desired collation at the time that you create a new database or database column.

Database-level collations
When a database is created or modified, you can use the COLLATE clause of the CREATE DATABASE or ALTER DATABASE statement to specify the default database collation. If no collation is specified, the database is assigned the server collation.
You cannot change the collation of system databases except by changing the collation for the server. The database collation is used for all metadata in the database, and is the default for all string columns, temporary objects, variable names, and any other strings used in the database. When you change the collation of a user database, know that there is the potential for collation conflicts when queries in the database access temporary tables. Temporary tables are always stored in the tempdb system database, which will use the collation for the instance. Queries that compare character data between the user database and tempdb may fail if the collations cause a conflict in evaluating the character data. You can resolve this by specifying the COLLATE clause in the query. For more information, see COLLATE (Transact-SQL).

Column-level collations
When you create or alter a table, you can specify collations for each character-string column by using the COLLATE clause. If no collation is specified, the column is assigned the default collation of the database.

Expression-level collations
Expression-level collations are set when a statement is run, and they affect the way a result set is returned. This enables ORDER BY sort results to be locale-specific. Use a COLLATE clause such as the following to implement expression-level collations:

SELECT name FROM customer ORDER BY name COLLATE Latin1_General_CS_AI;

For more information on changing collation, please visit http://msdn.microsoft.com/en-us/library/ms179254.aspx.

Friday, December 21, 2012

Using the "Shrink Volume" Utility

 One of the best kept secrets of Windows 7 is the "Shrink Volume" utility. TechNet Documentation explains it best at http://technet.microsoft.com/en-us/magazine/gg309169.aspx. Although, this link explains how to use it, it does not list all the advantages of using it.  That will be my goal for this article.

The utility will shrink the current volume, leaving all files intact, without a problem.  Although I used this utility many times in the past without issue, I still highly recommend performing a full back-up before using it.  After all, a good backup is always the best insurance against any unforeseen issue.

This free utility allows you to shrink a large volume on your hard drive that is not fully utilized.  For example, most developers have large hard drives.  In most cases, they probably have more than 100GB of unused space.  In addition, they most likely have a need to install additional OS for trial or multi-use purposes.  By using the Shrink Volume utility, you can now leverage unused space on your hard drive and install different OS’s.

For example, I have a machine with a 500GB Hard drive and only 1 partition (C :\).  This partition has Windows 7 installed on it.  With all my other storage on it, I was using about 300GB with the remaining 200GB unused.  I needed to install SharePoint and SQL Server for a new client but wanted to keep it separate from work I was doing for other clients.  SharePoint 2010 requires 64-Bit hardware so I could not run it in a Virtual PC machine.  I tried using Hyper-V but ran into several problems.

I used the Shrink Volume utility (as outlined in the TechNet documentation) to reduce my C: drive by 50GB, thus creating a new 50GB partition.  I used the new partition to install Windows 2008, SharePoint 2010, and SQL Server. A few months later, I needed to install Windows 8 so I did the same thing and extracted another 41 GB from C: by shrinking it.  Now I have three operating systems installed on my hard drive, each fully utilizing the 64-bit capability of my PC and all of its hardware components without any virtualization.

Boot Manager
After following the directions listed on the TechNet link above, I simply rebooted my PC with a DVD of the new OS inserted in the DVD player.  When prompted by the installer, I chose the new empty partition I recently created.  The installer then formatted it, installed the new OS, and setup the Boot Manager with all the existing OS’s.
After installation was completed, the PC rebooted once more.  After the system check, I was prompted to select an OS from the Boot Manager Menu within a specified number of seconds. 


Boot Manager Settings
The settings for the Boot Manager can be changed from two places. First, it can be accessed from the Control Panel > System > Change settings > “Advanced” tab > “Settings” in Startup and Recovery section.
The second method allows for more advanced options of the Boot Manager.  It can be accessed from Control Panel > Administrative Tools > System Configuration > “Boot” tab.

Partition Access
Once you select the operating system of choice, the PC will boot normally.  The partition with the chosen operating system will become “C:\” and the other partitions will be assigned other drive letters.  This happens automatically without user intervention.  The other partitions will be exposed and the files on them will be accessible. This allows access to the file system on each partition without having to boot into that specific partition. 

Summary
In closing, listed below are all key advantages of using the Shrink Volume utility.
• Free built in utility: The Shrink Volume utility is standard on all Windows 7 machines, as part of the OS.
• Reliable: All files are left in place without corruption.  However, a full backup is highly recommended before using this utility.
• Automatically configures Boot Manager menu
• All partitions are always visible and accessible
• Leverages your current investment in hardware by using free disk space
• New OS’s are installed natively on the machine, accessing all hardware without virtualization.

Tuesday, December 4, 2012

December Events

Local Events
12/04: ON SQL User Group (www.ohionorthsqlserverug.org)
12/11: Cleveland .Net User Group (www.bennettadelson.com)
12/18: Cleveland WPF User Group (www.ClevelandWPF.info)
12/19: Hudson Software Craftsmanship (www.hudsonsc.com)  

Regional/Online Events
12/04: Training on the T’s SQL Webinars (www.pragmaticworks.com)
12/08: CODODN-Columbus (cododn.wordpress.com)    

Tuesday, October 2, 2012

Area Events

Local Events
 10/02: ON SQL User Group (www.ohionorthsqlserverug.org)
10/09: Cleveland .Net User Group (www.bennettadelson.com)
10/16: Cleveland WPF User Group (www.ClevelandWPF.info)
10/16: Office 365 Great Lakes User Group (http://www.havilahtech.com/)
10/23: Cleveland C#/VB.Net User Group (www.ClevelandDotNet.info)

Regional Events
10/05: SharePoint UG Golf outing at Quail Hollow (www.SharepointCleveland.com/)
10/06: SQLSaturday 171-Pittsburgh (www.sqlsaturday.com)
10/25-26: m3 conference (www.m3conf.com)
10/27: SQL Saturday 174-Charlotte (www.sqlsaturday.com)
11/8-9: Dogfood Conference (www.dogfoodcon.com)
11/17: 1DevDay-Detroit (1devdaydetroit.com
12/08: CODODN-Columbus (cododn.wordpress.com
12/08: SQL Saturday 173-DC (www.sqlsaturday.com)

Friday, May 27, 2011

Intellisense not working

Q: While editing Script.PostDeployment.sql in a database project, intellisense stopped working. How can I fix this?

A: In Visual Studio 2010, intellisense has a defined limit on the file size. If the file gets too large, intellisense will no longer work on that file but the file will continue to build in the solution. Also, a message will appear in the Error List window explaing how to resolve this. The message will state "The script exceeds the Transact-SQL IntelliSense maximum script size setting. You can change the setting on the Text Editor/Transact-SQL/IntelliSense Page in the Tools/Options menu."

Wednesday, July 28, 2010

Array of Tuples

Q: How would use tuples in C# 4.0 to create an array of tuples containing various types of data (i.e. Employee Name, Employee ID#)?

A: Listed below is a sample code snippet to implement an array of tuples.

//Array of Tuples (i.e. EmpName, EmpIDNum)
Tuple[] EmpRecs =
{
Tuple.Create("Sam Nasr", 891),
Tuple.Create("Jim Smith", 358),
Tuple.Create("Lisa Jones", 962)
};

string FirstEmpName = EmpRecs[0].Item1;

string SecondEmpName = EmpRecs[1].Item1;
int SecondEmpIDNum = EmpRecs[1].Item2;


More information can be found at http://msdn.microsoft.com/en-us/library/dd413854(VS.95).aspx

Tuesday, July 20, 2010

MVVM Resources

Tonight's Cleveland WPF User Group meeting will continue last month's discussion on MVVM. For those who missed June's meeting, the following resources are available to help prepare for tonight's meeting:
• MVVM Overview (June’s Presentation): http://www.clevelandwpf.info/presentations/MVVMOverview.ppt
• MVVM, a WPF UI Design Pattern(17min video): http://channel9.msdn.com/shows/Continuum/MVVM/
• Problems and Solutions with Model-View-ViewModel: http://msdn.microsoft.com/en-us/magazine/ff798279.aspx
• WPF x FileExplorer x MVVM: http://www.codeproject.com/KB/WPF/WPFFileExplorer.aspx

For directions to the Cleveland WPF User Group, please visit www.ClevelandWPF.info

Monday, June 21, 2010

Local & Regional Events

Local Events
June 22: Cleveland C#/VB.Net User Group Meeting (http://www.clevelanddotnet.info/)
June 23: Cleveland SharePoint User Group Meeting (http://www.sharepointcleveland.org/)
June 24: Cleveland IT Martini (http://www.itmartini.com/)
July 16: Cleveland Give Camp (http://www.clevelandgivecamp.org/)
July 24: TechNic 2010 (Heidi Hooper - Heidi@BoundlessFlight.com)

Regional Events
June 26: SQL Saturday-Columbus (www.sqlsaturday.com/42/schedule.aspx)
June 25-26: CodeStock (http://www.codestock.org/)
August 5-7: DevLink (http://www.devlink.net/)

Saturday, May 29, 2010

Toughest Developer Puzzle Ever

So you think you're a hot shot developer able to resolve every problem that comes your way. Put your skills to the test by visiting www.toughestdeveloperpuzzleever.com. The site offers 100 levels of varying difficutly. To maneuver through the levels, you have to examine the page for cllues that will allow you to go to the next levels. Some pages have a hidden link, others require you change the URL manually, etc.

The site is scheduled to launch on May 31 and offers great prizes for the first 100 people to complete it, with excpetionally great prizes for the first 5! Put your thinking caps and visit www.toughestdeveloperpuzzleever.com!

Tuesday, May 4, 2010

T3CHn!c 2010 - Bringing the Northeast Ohio Technical Community Together

The 2nd annual TechNic will build on the camaraderie of the boundless IT community of Northeast Ohio with the support of companies and organizations by providing a free event for attendees to simply enjoy a summer day of classic picnic fun and activities.

Last year’s event brought together over 200 attendees and 20 supporting companies from around the globe! Pictures of last year's event can be seen here.

We hope that your organization becomes a part of T3CHn!c TM 2010. Feel free to include your friends, family, employees, customers, clients, partners, prospects, and their friends and families, too!

Logos of supporting organizations will be displayed on all announcements. Consistent mention and messaging on behalf of supporters will be made through social media and other public relations, with a higher level of promotion for top sponsors. Banners and other means of visibility will be displayed at the event.

Suggested donation guidelines:
$200 +.....................................T3CHn!c TM 2010 Sponsorship
$75....................................... Table Rental for Service / Product Demo
$100...................................... Keg
$50....................................... Food & Beverages
$Peerless................................. Prizes, Entertainment
$Priceless................................ Swag, Volunteers

July 24th, 2010, 11am – 8pm (Rain or shine!)
St. Sava’s Picnic Grove
2300 W Ridgewood
Parma OH 44134

For more information, contact:
Heidi Hooper
216-469-1163
Heidi@BoundlessFlight.com
Twitter: @Heidi1163