Tuesday, March 29, 2005

Can't We All Just Get Along?

It’s been a while since I’ve posted here.  Part of the reason for this is I’ve been in hiding for the last 10 days learning the ins and outs of ASP.NET 2.0.  Moreover, I’ve been trying to make it all work with Oracle, and when I say “make it work with” I mean get all those fancy new data bound controls to bind to Oracle data, and to do so by calling stored procedures in packages.

The good news is I made it work.  The bad news is it’s much harder than it should be.  Microsoft’s Oracle provider doesn’t readily acknowledge stored procedures in packages, and Visual Studio 2005 doesn’t readily acknowledge Oracle’s own data provider for .NET.

In a few days, I’ll try and list all the issues, and explain how ASP.NET 2.0’s ObjectDataSource control lets you work around them and still take advantage of data binding.  I’m also going to try and get people at both companies to look this over and maybe rectify things before Whidbey ships.  Since there’s every indication that said ship date is still nine months away, this shouldn’t be too tough, but, even so, never underestimate the potential for competitors to fall short of effortless interoperability.

#    |
 Saturday, March 19, 2005

News that’s Fit

 

If you travel (or live) outside North America much you’ll be familiar with the ubiquity of BBC World and CNN International.  The latter, in James Earl Jones’ voice identifies itself simply as CNN, just as its North American counterpart, but is in fact a very different channel.  Just to the right of the omnipresent CNN logo is a small, slowly spinning globe.  And that globe means a lot: the anchor desk is based in London and the programming is much more news-heavy, infotainment-eschewing, and editorially pure than CNN in North America.  Much like BBC World, the channel follows a format of 30 minutes of pure international news at the top of the hour followed by a variety of shows on the half hour.  Many of these shows like “Diplomatic License,” “Inside Africa,” “World News Asia” and “International Correspondents” are also chock-full of interesting world news content.  Anyone who remembers and liked CNN in the 80s will feel right at home watching CNN International.

 

Whether you’re conservative, liberal or somewhere in between, if you crave a news channel that isn’t sensationalistic and ratings-hungry and focuses on serious analysis of the news, BBC World and CNN International are terrific news programming sources.  The problem is that until recently, neither of these channels was widely available in the United States (I believe BBC World is available 24-hours a day on some Canadian cable systems, however).  CNN International was available all weekend and from midnight until around 8am each weekday morning by watching CNN fn, which was off the air at that time, but not on a full-time basis.

 

But now there’s a better option.  Recently, CNN fn went dark (which is too bad, I actually liked watching it) and on many cable systems, including Time Warner Cable’s DTV digital cable service in New York, CNN International has replaced CNN fn and is now on 24 hours a day.  On Time Warner in New York, you can tune to channel 133 and watch CNN International whenever you want.  If you think of it, at the top of the hour, tune in and see what you think.  If you’re serious about your news, this could become habit forming for you.

 

If you can’t get CNN International, or even if you can, you have another option for hard world news.  Many of the news half-hours from BBC World are carried on BBC America (a digital cable/satellite channel) and many PBS stations.  If you’re a news junkie and you have a DVR, you can do what I do: tell your machine to record all airings of BBC World News on all channels, saving only the one most recent recording (you may want to give the recording a relatively low priority so that it doesn’t pre-empt other recordings you’ve programmed in).  This way, you’ll always have a recent half hour of world news near the top of your recorded shows menu, and you won’t use more than a half-hour’s worth of hard drive space on your DVR. This approach works quite well, especially in markets like New York, with a number of PBS stations (including new digital-only PBS channels).  Here in NY, if you have digital cable, BBC World News airs on a total of five different channels.

 

By the way, both channels have their own Web sites.  BBC World’s is www.bbcnews.com, which redirects to http://news.bbc.co.uk/.  Unless you’re in the U.K., you’ll probably want to select the World Edition.  And speaking of selecting the World Edition, you can configure CNN’s main home page, www.cnn.com, to display CNN International’s content by clicking the International Edition link on the upper-right of the home page or by pointing your browser directly to http://edition.cnn.com.  Oh, and check out BBC World's front page RSS feed hereNews junkies of the world, unite!

#    |

Microsoft ISV Community Days Slides and Code

Code and slides from my Thursday 3/17/05 Lunch and Learn session can be found here.  The Projects and WebSites folders within the zip contain sub folders which should be copied into the My Documents\Visual Studio 2005\Projects and My Documents\Visual Studio 2005\WebSites folders respectively.  The SSProjTestScripts folder should be copied into the My Documents\SQL Server Management Studio\Projects folder. Throw the PPT wherever you please.

All code has been tested under the February CTP releases of Visual Studio 2005 and SQL Server 2005.  The three Visual Studio projects demonstrate SQL Server CLR techniques, ASP.NET data binding, and numerous ADO.NET 2.0 and Windows Forms data binding tricks (including binding to objects).  The SQL Server Management Studio project contains numerous scripts that manipulate and use the CLR stored procedure and User Defined Type implemented in the SQL CLR Visual Studio project.

#    |
 Monday, March 14, 2005

Techie Toilet Humor

Fellow RD Scott Hanselman and cohort Rory Blyth have created a rather off-beat Tech*Ed 2005 promo video.  I would rate it somewhere between PG and R.  More are on the way, apparently, but check out the first one here.

#    |

SQL/VS 2005 February CTP Code Changes

I've been playing with the February CTP of both Visual Studio 2005 and SQL Server 2005 this weekend.  One of my exercises for the day was trying to get a Visual Studio SQL Server CLR project that I wrote for SQL 2005 Beta 2/VS 2005 Beta 1 to compile.  The project has a stored procedure, a UDT, and a stubbed out function, aggregate and trigger.  I couldn't get this to compile in the VS December CTP, but I was determined to get it to compile in the new February CTP.

I got it to work, though not easily.  I found that some of my code was using constructs that are now deprecated (that was fast!) and I also encountered a few compiler and deployment errors.  In reverse-engineering the latter, I discovered that CLR UDTs and Aggregates now must be implemented as structures, rather than as classes.  With hindsight this makes sense but it's a rather stark change...now (it would appear) you can no longer store "objects" in the database.  Of course, nothing stops you from serializing a .NET object as XML and storing it in an XML column, but that's another story.

Here are a few other changes I "discovered" (I use quotes because these changes are in fact documented on other SQL Server-oriented blogs like Bob Beauchemin's and Wally McClure’s and that's how I worked my way through them):

  • The SqlContext.GetPipe method is replaced by the SqlContext.Pipe property.  This is extremely important because it is through the returned SqlPipe object that you can send data and text back to a client from a CLR stored procedure.
  • Likewise, the SqlContext.GetConnection method is replaced by SqlContext.Connection property
  • The SqlConnection.CreateCommand method is effectively replaced by SqlContext.CreateCommand method (making less necessary the use of the SqlContext.Connection property, described above) 

I also had the darnedest time getting even the stubbed out trigger to deploy.  Since my CLR project points to the AdventureWorks database, I defined the code as a FOR UPDATE trigger on the Production.Product table, using the SqlTrigger attribute and it just wouldn’t work.  As best I can tell, this attribute will not work on a namespaced table!  When I pointed the trigger to the non-namespaced “DatabaseLog” table, everything worked fine.  Since that’s not a table I would want to create my own trigger on, I worked around to the problem.  I removed the SqlTrigger attribute altogether, compiling the code as a plain VB Sub (function in C#), then after deploying the assembly, executed the following T-SQL code:

Create Trigger trgInsertTest

On Production.Product

For Update

As External Name [SSProjTestFebCTP].[SSProjTestFebCTP.Triggers].[trgInsertTest]

 

If anyone knows how to get the SqTrigger attribute to work with a namespaced table, I’d sure like to know.

 

#    |