Posts

Holiday Greetings:

I recently received the below Holiday Greeting from a compatriot, and decided to post it. No explanation should be needed: Dear XXX: With the holidays fast approaching and EULAs pretty much a fact of life, please accept -- with no obligation, implied or implicit, on behalf of the wisher or wishee -- my best wishes for an environmentally-conscious, socially-responsible, low-stress, non-addictive, gender-neutral celebration of the winter solstice, practiced within the traditions and/or within the religious or secular belief(s) of your choice and with respect for the traditions and/or religious or secular beliefs of others or for their choice to not practice traditions and/or religious or secular beliefs at all; and for a fiscally-successful, personally-fulfilling, medically-uncomplicated recognition of the onset of what is generally accepted as the new Gregorian calendar year, but with due respect for calendars of other cultures whose contributions to society have helped make America gre...

ASP.NET v1.1 Member Management Component Prototype

Checkitout: http://www.asp.net/MemberRoles/memberroles.htm

Server 2003 SP1 Release Candidate available NOW!

Here it is! http://www.microsoft.com/downloads/details.aspx?FamilyID=ae20c29d-5c71-49ce-9091-3aedc9e5979f&DisplayLang=en

Need to Get A HEAD?

Image
This nice little piece was recently posted by David Kline on his blog: Have you ever wanted to know what type of file was being pointed to by a given url before clicking the link?  Maybe you are writing an application that needs to filter out certain types of links.  A web crawler is a good example of an application which needs to do such link filtering (skip links to graphics, audio, zip files, etc). In order to check the type of data pointed to by a url, you are going to need to issue a request to the server.  Normally, this involves receiving the entire page or file at that location.  This can be a time consuming proposition, especially over slow network connections, and defeats the purpose of allowing your application to filter out undesired links. The solution is to issue a request to the server, asking only for the HTTP headers.  This "HEAD" request is small, fast (does not transfer file contents) and provides you with exactly the data your application...

Web Services Enhancements 2.0 SP2 (WSE 2.0 SP2) Released today

This release fixes some top customer issues and provide a new security token, KerberosToken2, which supports impersonation, windows constrained delegation.  The new token also works well with the web farm scenario. Download WSE2 SP2 from http://msdn.microsoft.com/webservices/building/wse/default.aspx

IsNumeric in C#? Not!

Recently we had another "go around" at the office regarding IsNumeric in C#. We had a forum discussion on this at eggheadcafe.com some time ago, I suggested to use the Microsoft.VisualBasic.Information.IsNumeric method, which can certainly be called from C# or any other .NET language. Two other developers, both of whom I highly respect, have gone quite a bit deeper into this; J. Ambrose Little here and Justin Rogers here . Only Rogers actually made reference to the fact that the VisualBasic method does a significant amount of type-checking under the hood; type-checking that was not included in either of their test suites. The bottom line is this: If I put "$1,079.51" into Ambrose's VisualBasic method, it returns true, because that string, indeed, "IS" numeric. Other methods tried will either incorrectly return false, or will actually hang and not return at all. According to the Microsoft definition of "Numeric", depending on the CultureInfo,...

MSMQ 3.0 and Multicast

Amazing what you can learn when you RTFM, ya know? From the Message Queueing in Windowx XP: New Features : MSMQ 3.0 in Windows XP extends the regular MSMQ programming model from one-to-one to one-to-many. The traditional MSMQ model allows a single message to be sent to a single queue. However, the one-to-many messaging model enables clients to send the same message to multiple recipient queues. MSMQ 3.0 offers multiple ways to implement this model: " Real-time messaging multicast " Distribution lists and multiple-element format names In MSMQ 3.0, one-to-many mechanisms provide the application developer with the fundamental tools required to build sophisticated publish and subscribe systems. These kinds of systems are useful for addressing reliable information dissemination scenarios. Real-Time Messaging Multicast MSMQ 3.0 provides a mechanism to send messages on top of IP multicast. Specifically, MSMQ 3.0 uses the Pragmatic General Multicast (PGM) protocol (see http://www...

Another Believer! (EXEC sp_name param, 'param') -Not!

Vis-a-vis my last number on why not to use "Exec spname paramvalue" etc. -- my friend figured out that all the places he was doing new SqlDataAdapter("exec mysp 1,5 'hello'"); are open to SQL injection attack (he thought they were immune to it). Why? Simple- if an attacker can get access to the SQL string they can just add ";DELETE TABLENAME". DOH! So now he is happily rewriting everything to use SqlHelper and turning all those inline text strings into object[] parms={1,5,'hello'}; object arrays. You see that? You are only dumb when you think you know everything....

ADO.NET and SQL Server Optimization

Recently a compatriot and I got into this diatribe over the use of CommandType.Text and "EXEC spName param, param, ..." to make SQL Server stored procedure calls. I had chimed in on his answer to a poster who was having difficulty with a sproc call, and he suggested "you don't need to use the Command Object" and proceeded to show an illustration like the above. Even after I had provided some pretty good background material on why this is not a good idea, he continued to hammer on little pieces of the subject, in effect missing the big picture. There have been many times I've been corrected. As I've grown older (and hopefully wiser) I've learned to put my ego in my back pocket and thank the person for the education. And you? I guess what I am trying to say is this; you have two MVPs who didn't know about this. The only reason I found out about it is because I was lucky enough to attend Tech-Ed 2004 and sit in Gert Drapers' presentation. So ...

SWIG - Creating Managed Wrappers

Today I discovered SWIG - which makes writing managed C# wrappers for unmanaged C++ libraries and DLLs hugely easier. I am in the process of studying managed C++ wrapper code, "It Just Works" and P/Invoke to handle some needs related to exporting methods from telephony board APIs. Although I haven't gotten very deep into it, one look at all the C# code SWIG generated from a single imported *.h header file has me convinced!