T-SQL: INSERT for Table w/ Only IDENTITY Column

In the event that you wish to insert a record into a SQL Server table that contains only a single column, and that column is an IDENTITY column, here is the statement:


I am primarily saving this so that I don’t have to go searching for it (yet again) the next time I need to do this.

Posted in SQL | Tagged , , , | Comments Off

jQuery: First (Matching) Sibling

I wanted to select the next sibling element after the current one for an event handler, using jQuery. The desired behavior is to be able to click a heading (<h3>, in this case) and locate the very next <div>, <ol>, or <ul> (with an intervening <a> tag) and toggle its visibility. It took me several tries to get this right, so figured someone else may have an issue with it.

(Spoiler: use $('h3').nextAll('div, ol, ul').first().)
Continue reading

Posted in jQuery | Tagged , , , | Comments Off

A Reason for Non-deferred LINQ Statement

Someone (two people, actually) asked on StackOverflow.com why someone would want to force a LINQ statement to execute immediately rather than allowing deferred execution. Since I can’t respond to the comments yet, I’ll explain here.

Continue reading

Posted in .Net | Tagged , , | Comments Off

Failday: AT&T and Google

Had two not-so-awesome experiences, this morning; first up was a password change at AT&T, followed by installing Picasa.

Continue reading

Posted in Cyberlife | Tagged , , , , , , | Comments Off

Nexus One: New to Me

After five days with a Nexus One (courtesy of ebay), let me say this outright: I love it. That is not to say it’s not without its flaws, but its high points outweigh its drawbacks.

I wanted the phone for two reasons: First and foremost, I wanted an Android device. I had been using a Nokia N900, which was a great phone four its day, but I was experiencing app-envy, and the N900 was starting to feel slow, especially compared to my wife’s iPhone. (I didn’t want an iPhone for reasons I won’t detail here.) Second, I’d like to start doing mobile development, so a Google device (i.e., vanilla Android) seemed like a logical choice.

I panned the Nexus S for its lack of removable storage, though I may reconsider that in the future with cloud-based services, like Google Music and Amazon Cloud Player, since music is definitely my largest space eater.

The phone feels good in my hand, the screen is beautiful (I know others are better, but that’s not a concern right now), and operations in the phone are quite responsive. Battery life isn’t great, which is due in part to the relatively small battery and in larger part to the fact that I use the phone nearly constantly.

In the app department, my favorite is definitely Swype. I’m using it right now, and not only did it start out fast but I’m getting faster and faster with practice (and as Swype learns my habits). Others that have gotten quite a lot of use are Launcher Pro and Beyond Pod. I really like Opera Mobile for a web browser, but it has an annoying tendency to crash. Firefox has its own pluses, but has a terribly long load time.

My biggest complaint about the phone is the bottom of the screen appears to be divided between the “buttons” off the bottom of the screen and whatever is actually on the screen. This most often bites me, sadly, while writing a message. I have at times lost my message by accidentally hitting one of the keys off-screen.

I’ll have this phone at least a little while, but it has already convinced me to make my next phone an Android device. (If only I could justify the cost of a Galaxy S II…)

Posted in Android, Mobile | Tagged , , , , , | 1 Comment

Visual Studio 2010 Database Errors

I have had several error messages related to utilizing SQL Server in Visual Studio 2010. Two of them occur on startup; I did not get screen caps of those, but I recall they have “RadLang” in their name.

When Visual Studio 2010 starts up, it sometimes gives me two error messages. I did not get the opportunity to screencap them before they disappeared forever (I inadvertently selected the “don’t show me these errors again” option on the error dialogs), but they relate to the “RadLangSvc” package.

I could ignore the errors, but they would rear their ugly heads when I tried to access some aspects of SQL Server.

Continue reading

Posted in .Net | Tagged , , , , , , , , | Comments Off

Android Cannot Connect Via WiFi

Got to work with my new (to me; thanks eBay!) Nexus One Android phone (which I love), connected to the work WiFi network and…couldn’t connect to anywhere on the Net.

I was able to connect to the WiFi network just fine, got an IP address, gateway, DNS, etc., but no Internet connectivity anywhere. Disconnected from WiFi in order to download some exploratory apps (notably WiFi Widget and Ping & DNS), and finally came across an article by Rudd-O: “WiFi / DHCP network not working with your Android phone?” which pointed to a bug over a year old as of this writing.

Rudd-O describes a workaround by changing the DNS server, but I don’t have that option. So, I used IP Manager to create a static profile for use here at work. I’ll have to create another profile for everywhere else when I get home.

Speaking of which, my new phone worked fine on my home WiFi network. Apparently, Android is not affected by all wireless routers, which is likely why the bug still exists.

Posted in Android | Tagged , , , , , , , , | Comments Off

SQL Server 2008 Database Diagram Crash

I am able to get the SQL Server 2008 Design Diagram to crash reliably. I prefer to use “Custom View” with some useful column such as “Identity” and “Default Value” to make it easier to quickly get new table structures created.

I prefer to use the “Allow Nulls” checkbox column (the one you see in the Standard view) to the “Nullable” Yes/No column that is in the default Custom View (so I can more quickly spacebar NULL/NOT NULL). However, adding “Allow Nulls” then changing the column order will crash SQL Server Management studio 100% of the time.

As a workaround, you can remove any Custom View columns already in place that you wish to appear after the “Allow Nulls” column, then re-add them after you’ve added “Allow Nulls.”

My installation’s @@version:

Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)
    Sep 16 2010 19:43:16
    Copyright (c) 1988-2008 Microsoft Corporation
    Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

Sadly, I discovered this bug only after having spent a couple of hours putting together a database design. C’est la vie!

Posted in SQL | Tagged , , , , , , | 2 Comments

Windows Update Failing KB2419640 / 80070011

If you have your Program Files directory on a separate drive (drive letter) from your Windows directory (using hardlinks on my system to point from C: to F:), Windows Update will fail for some updates. Mine failed for KB2419640 with the completely unhelpful error 80070011.

Fix: Update the Program Files-related items in your Registry at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion. E.g., ProgramFilesDir “C:\Program Files” –> “F:\Program Files.” Then, voila, it works!

Posted in Windows | Tagged , , , , , , | Comments Off

Multiple jQueryUI Themerolled Themes inside ASP.Net App_Themes

One of the things I love about jQueryUI is the fact that it can generate a download based upon one of several great-looking themes. This rolls up all the images and CSS into a single zip along with a customized JavaScript file. This is awesome, but what happens if I want to grab multiple themes, drop them into an ASP.Net website, and be able to switch between them?
Continue reading

Posted in ASP.Net, jQueryUI | Tagged , , , , | Comments Off