Posts

Showing posts from March, 2007

"Internet Explorer has stopped working" Redux (unfortunately)

OK. Now I'm annoyed . I've already UnBlogged about this here and now I'm seeing it again . If I use our search facility on eggheadcafe.com and enter "which control posted back" you'll get this url: http://www.eggheadcafe.com/articles/20050609.asp . When I click on this in IE 7.0 (on Windows Vista, dear Reader...) I get the dreaded "Internet Explorer has stopped working" BS. Some people get this, others don't. For me, the page comes up and almost at the point where the browser has completely loaded it, that's where IE blows up. There's nothing unusual about that page, it's like every other article on the eggheadcafe.com site. Lots of people have reported this issue with lots of different web pages, just because it doesn't happen to you doesn't mean everyone else is nuts, OK? Yeesh! No wonder they call it "Internet Exploder"! It doesn't matter if I reset IE, it doesn't matter if I run "as Administrator...

Read / Write Large Value (Blob) Types in SQL Server 2005 with ADO.NET 2.0

I saw somebody's post on the C# newsgroup recently where they had posted some chunked code to use a do / while GetBytes pattern to read from a Varbinary(MAX) column. The code was fine, but it sure was a lot of code, because the individual who posted it was accumulating the entire block of data in memory anyway and then proceeding to use it. There is a much simpler way, with SQL 2005 and ADO.NET 2.0: //-- READ - reading a varBinary(MAX) columm... System.Data.SqlTypes.SqlBytes myBytes; System.Data.SqlClient.SqlDataReader dr; System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(); dr = cmd.ExecuteReader(CommandBehavior.SequentialAccess); // SequentialAccess allows chunked reading with offsets, etc. myBytes = dr.GetSqlBytes(1); // return a SqlBytes type containing the entire contents of the column System.IO.Stream s = myBytes.Stream; // get the stream property Bitmap B = new ...

Bong Hits for Jesus, Mescaline for Moses...

Please. Give me a break, OK? This kid wants to exercise his right to free speech on a public sidewalk across from his school's outdoor event, and the fyookin' Principal comes across the street and physically takes down his banner and supends him from school for five days? Somebody is smoking SOMETHING, but it ain't common sense -- that's for sure! I should note that this happened in 2002 - it's coming up now because the Supreme Court of the United States agreed to hear it today. This is not a small deal - its a very big deal - but we'll probably have to wait for summer 2007 before the Court rules on it. Look, I grew up smoking pot. I can't smoke it any more, maybe I'm too old, I don't know - it makes me crazy now. But one thing I know is this - compared to alcohol, pot could be the most innocuous illegal substance there is - provided you have enough sense not to go driving on the freeway while you're high. Let's not forget that not too many y...

MVP Summit Musings - 2007

Each year, Microsoft invites current MVPs (Most Valuable Professionals) to Seattle for their annual MVP Summit. MVP's get access to Product Group specialists and other dignitaries from Microsoft who share their visions of what Microsoft is doing and where they are going. Some of this information is "not to be disclosed", meaning that the MVP can find out about it but we aren't supposed to talk about it until the bits are released. In sum, we get wined, dined, and seminar-ed to death. This year, as I did last year, I had mixed feelings about the whole thing. Yes, I got to meet and talk with people who I respect such as Scott Guthrie ("Mr. ASP.NET") and Anders Hejlsberg, "up close and personal" which is always gratifying, as well as my MVP lead Rafael Munoz, who has been a fantastic resource for me as a .NET professional. Among other notables too numerous to detail, I also ran into Jason Alexander and Rob Howard, and we got a chance to chat about the...

IDisposable and Conservative Politics

There is a saying "You become a Conservative when you've got something to conserve". In the programming world, it could be said that "You should only implement IDisposable when you've got something to Dispose". Here is an interesting Q/A interchange between a confused C# newsgroup poster, with some very good answers by Barry Kelly : Q: "A discussion arose recently in a code review about whether or not one should implement IDisposible (and then call it) on an object which has neither unmanaged resources nor managed resources which are resource intensive (db connections, filestreams, etc.)." A: If a class implements IDisposable, that tells me as a programmer that I *need* to call Dispose() when appropriate. If the class doesn't own other objects which implement IDisposable, and isn't likely to do so, then I would say - don't implement it. But if you do implement it, implement it properly. Create a protected virtual void Dispose(bool dispo...