Jason Nadal

Restless C#ding

February 2006 - Posts

GridView and DataKeyNames
If you're trying to create a gridview, automatically bound to either a SqlDataSource or an ObjectDataSource (the better of the two options), and want edit and delete functionality, do not forget to set the DataKeyNames property to the primary key of the table or object you are trying to delete. Otherwise Edit/Update seems to work, but Delete will complain that it cannot find the parameter, even if you are defining DeleteParameters in the DataSource itself.
If you're not able to install the WinFX SDK (Feb CTP)....

...then you might be running into this issue with the installers, as reported by Jason Sacks. Keep your eye on his blog for a resolution to this. Here's the telltale sign in the install logs that you'd see:

[SDKSetup:Error] Config_Products_Install: Windows SDK Setup (failed): Installation of the "Microsoft Windows Software Development Kit" product has reported the following error: Fatal error during installation.

Update: seems this may be due to a bad iso -- either because of me or msdn. But the second download worked like a charm!

Posted: Feb 25 2006, 08:59 AM by thejay2 | with no comments
Filed under:
Check for the existence of a sql temp table

Here's an easy way to check if a temp table exists, before trying to create it (ie. for reusable scripts) from Simon Sabin's post :

IF object_id('tempdb..#MyTempTable') IS NOT NULL
BEGIN
   DROP TABLE #MyTempTable
END

CREATE TABLE #MyTempTable
(
   ID int IDENTITY(1,1),
   SomeValue varchar(100)
)
GO


That way, if you have to change databases in the query window, you don't have to drop the tables before you run it again.

Posted: Feb 24 2006, 08:10 AM by thejay2 | with 23 comment(s)
Filed under:
Watching the Olympics ... in 3D
I had ordered some 3D glasses for a very old TV show, based on the Pulfrich effect, in fact the show mentioned on that site, Doctor Who. I found a place online selling them for only 99 cents each, called Science Stuff. The cool thing is that they are great for sports with a lot of motion (like skiing, or what happens to be on the Olympic coverage now, replay of Figure Skating. The principle is that by tinting one side, you're slightly slowing the light hitting your eye, causing your brain to percieve 3D. There's the normal sensation with 3D glasses after you take them off, where your eyes feel wierd seeing the same amount of light in both eyes again!
What's causing that bluescreen?
I found a great resource that is a knowledge base of extremely detailed info regarding stop errors, also irreverently known as Blue Screen of Death (BSOD) errors. For anyone thinking that they can't look up the error while the machine is in a blue screen, after a reboot, the stop error will be in the Event Log.
Awaiting Windows Vista Feb CTP
I'm eagerly awaiting the rumored February CTP of Windows Vista.  Bink.nu reports it will be made available today, February 22nd 21st. Also rumored to be in this build is the return of the prodigal sidebar. We shall see....

Update: apparently it's been pushed back a day, according to this article. Thanks for the update, Jesse Ezell
Virtual Machine failure

While I've had plenty of experience in fixing seemingly dead physical machines, the death of my Team Foundation Server Dec. CTP machine has me flummoxed. It just sits there with a blinking cursor when I start the vitual machine up. This leads me to the following potential problems:

  • Beta software - can't trust it? I don't believe this is the case this time -- windows doesn't even look like it's starting up
  • Bad physical machine - scratch this one, too. The hard disk is only a couple weeks old & other virtual machines work fine
  • Bad virtual disk - potentially yes, but I hope not. How can I verify a bad virtual disk? Maybe I'll try booting knoppix off of the virtual machine & running scans.
  • Windows Gone Wild (on the virtual machine) - potentially, but I can't even get a boot menu to show up... just the blinking cursor, and CPU usage through the roof (complete with CPU fan ramp up and screaming).

I'd like to get this back up and running so I get my beta source repository back. For now I'm working disconnected, which works exceedingly better than in previous iterations of Visual Studio.

Streaming with /mceDivX360

I finally found a way to stream DivX movies fairly reliably to my XBOX 360... This is a freeware addin for Windows Media Center called /mceDivX360.

What it does is allow you to create a list of DivX movies, pass that list across to Windows Media Encoder (a free MS tool, and a prerequisite for this method), and play them from the XBOX 360 by viewing the stream from the PC.

What this is actually doing behind the scenes is encoding (hence the encoder) the movie / tv show / whatever to ASX / ASF on the fly, and passing THAT to the 360. The 360 knows how to play an ASF, and does so with no problem.

Caveats:

  • The encoding/streaming process is not cheap -- performance on the host pc will suffer, but you don't really care about that, right? You're watching a movie.
  • There's an issue with DivX potentially giving problems. Check the event log on the PC after a failed attempt. The fix is here if you see something like "Unauthorized window was detect while running the Media Center Experience" (complete with typo)

 

Free torrent source code

After being away for a couple of days on vacation & catching up, here's a bit more of a frivolous post.

FTKernelAPI is an open source library for connecting to the bittorrent protocol trackers. With this library, it's simple to write a torrent app... or you can just use a third-party prepackaged solution, like uTorrent, but where's the fun in that?

SQLCMD Mode (SQL Management Studio)

By entering SQLCMD mode in a SQL Server Management Studio query window, you can do some very handy things without needing to jump back out to the command prompt.

Commands can be run just like at the command prompt, by prefixing the line with "!!" a la:   

!!bcp MyDatabase.dbo.MyImportedTable in c:\temp\sqlimport.dat -Umydbuser -Pmydbpass -Smydbserver -n

And by executing (ctrl+e) that line, it'll import your database... easy, and if you save in a database project,
you can even have these included in the source control flavor of your choice.

Posted: Feb 10 2006, 09:04 AM by thejay2 | with no comments
Filed under:
More Posts Next page »