Craig Gemmill's Blog

There is nothing more secure than an educated user!
SQL Intellisense not working? Maybe you have an offline database.

Beside the regular culprits, an offline database will cause Intellisense to fail as well.

Detaching or bringing the offending database online will resolve the problem.

Site always renders in quirks mode? DOCTYPE must be the very first item on page!

Every now and then I'll throw a Response.Write() in my code to do some debugging. It always messes up the entire layout of the page when I do that, but I never really bothered to know why. After all, it’s just a temporary situation.

Turns out that the DOCTYPE declaration must be the very first line in your page or the browser will render in quirks mode. When you use Response.Write() on the page, it puts the output before the DOCTYPE, which will cause the above mentioned issue.

So if you're using Response.Write() for anything, make sure your DOCTYPE is first in line. It's worth mentioning that you should also make sure it's a well-formed, non-quirks, DOCTYPE declaration.

Visual Studio 2010 Service Pack 1 - Test first!

It appears that our run of fairly benign VS SP’s is over…

I've now installed the VS 2010 SP1 in a few simple test environments (x64) and all of them are having issues.

Add-in failures, failed package loading, missing SQL Intellisense, XAML designer failure, etc.

Make sure you test this Service Pack thoroughly before you release it to your production environment.

Microsoft Connect is the official repository for issues with Service Pack 1.

Open Paradox database with Access or as SQL linked server

First and foremost, if you're using Office 2010, Paradox support has been removed (http://technet.microsoft.com/en-us/library/cc179181.aspx). You'll need Access 2007 or earlier.

If you're reading this, then you've probably run in to a cryptic error message and/or inconsistent Paradox functionality with the aforementioned products. The most common error message being: "External Table not in Expected Format"

Here are two of the most common resolutions:

 

- You probably NEED BDE (Borland Database Engine), available here. I know there are articles that talk about it working without BDE, but I’ve never seen it happen.

- You may have to copy the Paradox database files locally. There is sometimes an issue with accessing the files across a network path.

 

That’s it. Try it.

Good luck,

Craig

DELL EMC AX4-5 vault drive upgrade

Ah, the DELL rebranded EMC Clariion AX4 (AX4-5SC, AX4-5, etc). It's awesome, but man do those Vault drives (and DELL/EMC support) make it so unfriendly.I’ll skip most of the background, and just get right to it.

First and foremost: This is an account of my experiences. Your experience will probably differ, and you’ll probably lose all of your data. Try this at your own risk.

We picked up a couple of these devices through an acquisition and they simply didn’t have drives large enough for our intended use. Upgrading the non-Vault drives is simple… pull out, plug in. Of course, you have to use EMC formatted drives (non-EMC SAS/SATA/FC drives will NOT work), which are pretty hard to procure from EMC directly without a valid support contract. It turns out that DELL is actually pretty well aligned to get these. Some of our other suppliers had month+ waits, but DELL had them to us in a few days.

Now, the Vault drives: The Vault drives are the first 4 drives in the AX4-5 (0,1,2,3). You can identify them by the little yellow stickers that warn you not to move the drives from their location. And you shouldn’t. The Vault drives contain OS, config and other information. If you pull these drives from the system, it will not fully boot (you can still connect via serial). If these drives fail in a certain sequence, the same fate will ensue. Simply put, you need them to be healthy.

If you do happen to trash the Vault drives for any reason, you can buy the 4-pack formatted and pre-loaded through DELL/EMC, but there is a premium, and finding someone who can actually get the part numbers is difficult at best.

Upgrading the Vault drives is generally a taboo subject for the end user, and I don’t condone it either. I’m sure it voids your warranty, lights Churches on fire, and brings Justin Bieber to haunt you in your sleep… but if you’re not using them in a production environment, or you buy them second hand on eBay, what the heck, right? I’m in.

This is not about upgrading Vault drives by using new Vault drives, as I don’t have any experience with that. When we put in a new 4-pack of Vault drives, we just swap them entirely and destroy any arrays/pools that are already created because we generally are putting in larger disks and want to be able to utilize the entire space.

EMC Powerlink is EMC’s customer portal. http://emc.powerlink.com

You can sign up for a free account, register your AX4-5, and then access firmware, downloads, support, etc.


Anyway, upgrading the Vault drives by using non-Vault drives:

1)     The AX4-5 should already be fully initialized. If it’s not, there is a tool that comes with the system to do this. It can also be downloaded from the EMC Powerlink site. Navisphere Storage System Initialization Utility.

2)     I’m 99% sure that all of the Vault drives have to use the same interface as each other, and you probably want to match the old Vault drives too. If you have SAS vault drives, use new SAS drives. SATA = SATA.

3)     The size of the new drive has to be greater than or equal to the old Vault drive size.

4)     DISCONNECT all hosts attached to the device via Fiber or iSCSI.

5)     Boot the system and bring everything online.

6)     Your array should not have any warnings (no orange lights). For instance, one time when I did this procedure, Storage Processor B was turned off. When I was done, I couldn’t get Storage Processor B to reinitiate no matter what I tried, and we got all kinds of “software cannot talk to storage processor” type errors.

7)     If available, upgrade the system firmware. Can be downloaded from EMC Powerlink site. Follow all directions and wait for system upgrade to finish completely.

8)     Pull out the Vault drive marked #3. The light by the drive may turn a solid orange at this point. Insert the new drive to be used as a Vault drive.

9)     The lights will flash blue (and possibly orange). Let the lights do their thing. At this point, the drive is replicating data from the remaining Vault drives. In Navisphere, you will see the new drive show up as “transitioning”. When the blue lights have stopped flashing completely or Navisphere shows the drive status as healthy, it’s done. Repeat step 8-9 for the Vault drive marked #2, then #1, then #0.

If the orange light next to the drive comes on solid, or flashes orange/blue every second for more than a few minutes, something is wrong. Put the old Vault drive back in.

10)  If you must abort the process, perform steps 8-9 backwards by pulling out the new drive and putting in the original drive. One drive at a time, allow time to complete.

11)  After you have swapped out the last Vault drive, all lights should be blue, and all components should be operational.

12)  If you decide to put all of the original Vault drives back in at a later date, you have to repeat the process all over again using the original Vault drives. You cannot just swap out all of the drives at one time.

 

Good luck,

Craig

Beware: Group Policy DNS Settings
I like to keep my posts targeted at more obscure topics (at least that's my excuse for not posting more often), and this one is no exception.

We have started the process of integrating several disparate companies as part of a corporate acquisition. We chose a location similar to the corporate HQ for the first migration, believing that it would be the easiest location to roll over.

We proceeded to migrate this location...

Sure there were some bumps and headaches along the way, but everything had a straightforward solution. The kind of issues that you figure out by using the right combination of experience, tools, and kb searches.

Using Active Directory Migration Tool (ADMT) (as we have many times in the past), we started to migrate the workstations. The machines accepted the ADMT agent install, joined the new domain, and rebooted. Upon rebooting, the machines were not updating their Service Principal Names (SPN) in Active Directory (AD), or their A records in DNS. The event log on the migrated machines were throwing the following errors:


Error: 5788
Attempt to update HOST Service Principal Names (SPNs) of the computer object in Active Directory failed.

Error: 5789
Attempt to update DNS Host Name of the computer object in Active Directory failed. …


And as a result, the machines weren’t really a part of the target domain, which obviously caused all kinds of other issues.

Clearly a DNS issue, but all of the tools we’re reporting correct settings and behavior. A lot of digging later, a setting was found in the Group Policy of the source domain that proved to be the issue. It was the “Primary DNS Suffix” policy pointing to the source domain instead of the target.

As the title says, beware of the Group Policy DNS settings, especially “Computer Configuration\Administrative Templates\Network\Dns Client”.

It turns out that these settings take precedence over all of the information supplied in your interfaces, DHCP settings, etc. Even worse than that, these settings do not show up in the output of any of the tools we’ve come to rely on (ipconfig, netsh, Powershell, etc).

While this certainly will impact anyone performing migrations, it also has a much wider scope of interference.

I hope this saves someone the time we wasted.

Here is a Microsoft KB that actually has the Group Policy issue noted at the end of the article: http://support.microsoft.com/kb/258503

 

A New Era of Software

I was reading a post by Rob Chartier titled, "Microsoft needs to give developers a break...", and anyone whose been keeping up with news from Microsoft these days can easily assume that his post is talking about all of the new and soon-to-be software releases. I was going to leave him a comment, but it soon became a post.

Overall, I agree... but it's bitter-sweet. I love new technology, always have... and I'm particularly thrilled with all of the new bits for Developers, IT Pros, and even the daily user that are being, and will be released by Microsoft: WF, WCF, WPF, ATLAS, Vista, CardSpace, Exchange, SMS and all of it's buddies, Longhorn, Storage Server, ISA, MapPoint, Office, IIS, IE, Live, WinMo 5, CE 6, PowerShell, SharePoint, BizTalk... and on and on.

So what makes it different from the last several years? Well, it’s easily overwhelming because a lot of these new releases are not relatively simple updates to the software we know, they're so different that it's like learning an entirely new product.

Also in the past, we've seen a lot of new software come out that was not easily adopted by small-businesses. So unless you were strictly working with major corporations, you had some time to play with software before you saw it become widely used. Now, small-business is booming and MS is releasing a lot of "lite" versions to meet these companies’ needs and budgets, so it's not leaving us much time to get familiar with the products before they become main-stream.

The sweet side of this is that it's new technology, and it's only a matter of time before you figure it out.

A new era of software is upon us and I'm just excited to be a part of it.

Halloween Horror: The SQL Timeout

I don’t know when it started or why, but I love Halloween (and autumn for that matter). So keeping the tradition of Halloween alive, I’ve decided to share some “horror” stories from the software/IT field over the next few weeks.

 

The SQL Timeout…

 

A few years ago, myself and another developer were brought in to help get a project moving along that had been at a stand still basically because it was the first ASP.NET app the existing team had tried to tackle. They sure picked a whopper to take on as their “learning” project too, but that of course ended up being bitter-sweet for me. I should add that the team was very competent and well experienced; they just lacked the .NET mojo.

 

Anyway, by the time we got involved; they had laid most of the foundation and were starting to build the other layers on top. Due to the existing project state and the time-constraints, we were forced to do a lot of independent testing during development. When a major milestone in the project was reached and it came time to stress/load test the application, we were expecting similar results to those found in the independent tests (famous last words). Well… not quite. We kept getting a SQL Timeout Error whenever there were multiple, simultaneous requests for databound pages, and we couldn’t test anything beyond that point. The weird thing about this was that it didn’t just happen under heavy loads; it simply happened when there was more than 1 request.

 

I’ll spare you the story about all the things we checked and re-checked from the hardware to the end users. In the end, I found that someone had declared a SqlConnection object as Static/Shared in the heart of the O/R mapped code. So anytime a request was processed, it was using the same SqlConnection object as the previous request (remember, this is a web-app) and would kill the previous request. The result would be a SQL Timeout Error for any of the requests before the last. Ah, memories.

 

The moral of this story is that you should be very weary of creating Static/Shared databound objects in ASP.NET applications, especially connection objects.

 

Oh yeah, boo!

Search.Live.Com. I want to like it, I really do...

Since it's no longer tagged Beta, its fair game right? Well, I have to be honest; so far I've had nothing but bad experiences with using the Live.com search engine. I'll give you my latest example:

I was watching a video of Victor Wooten, one of the most unique bass players around. Being a bass player myself, I like to learn other people’s styles and try to incorporate them into my music. So what's one of the first things you do when you need help learning someone else's song? Tab search, of course! Just look at the difference between Live and Google results for the value "wooten amazing grace bass tab":

Live: http://search.live.com/results.aspx?FORM=IE7&q=wooten+amazing+grace+bass+tab
Google: http://www.google.com/search?q=wooten+amazing+grace+bass+tab

It almost feels like the Live search results are based around trying to sell you stuff rather than relevance.

I tried every combination I could think of, short of searching for an exact URL. I even tried other search engines and was surprised to see that every other engine actually returned more relevant results than Live... except for Lycos. Then I noticed at the bottom of the Lycos page, it says: "Portions powered by Windows Live". Well, no surprise there.

I have hope for the future of Live search, but for right now I'm just a little surprised it's not still in Beta, because it really should be.

VB.NET Hexadecimal to Floating Point / Single (IEEE 754)

A post just came across the forum I frequent regarding Hexadecimal to Floating Point conversion. Strangely there appears to be no direct way to do this in .NET, and the solutions I found were pretty lame and tedious… so it became my mission to get it done the .NET way, and here is the result:

    Private Function ConvertHexToSingle(ByVal hexValue As String) As Single

        Try

            Dim iInputIndex As Integer = 0

            Dim iOutputIndex As Integer = 0

            Dim bArray(3) As Byte

 

            For iInputIndex = 0 To hexValue.Length - 1 Step 2

                bArray(iOutputIndex) = Byte.Parse(hexValue.Chars(iInputIndex) & hexValue.Chars(iInputIndex + 1), Globalization.NumberStyles.HexNumber)

                iOutputIndex += 1

            Next

 

            Array.Reverse(bArray)

 

            Return BitConverter.ToSingle(bArray, 0)

        Catch ex As Exception

            Throw New FormatException("The supplied hex value is either empty or in an incorrect format. Use the following format: 00000000", ex)

        End Try

 

    End Function

 

 

ConvertHexToSingle("3C000000")

Even though this is just a rough example, it does work, and it can be expanded to support larger types (such as Double) with a couple of small mods.

 

More Posts Next page »