Category Archives: ASP

Calling COM from .Net, and vice versa

I’m working on a project that uses web services code written in .Net (‘cos it’s heaps easier that way) but calls legacy code written in VB6. And vice versa.

(Wow, I never thought I’d be referring to VB6 code as legacy, but there you go. None of your smart comments, any VB-haters out there.)

Here’s what I’ve discovered about making it work. Continue reading

Migrating .Net 1.x to 2.x

Having got Visual Studio 2005 into my hot little hands, I’ve upgraded one of my projects from VS 2003 to 2005, and .Net Framework 1 to 2. Just loading it into VS2005 seemed to do most of the work for me.

I did find the new VS gives out a few very informative warnings in the code editor, such as unused variables. Good stuff (and shame on me for being so sloppy during repeated revisions of code).

The other thing I found was a few things had changed in the Web.Config file format. After much fiddling I found it easier to create a fresh one and copy my custom settings into it, than try and convert the old one over.

The only catch is that after copying it all over to the test server, it didn’t work. Turns out apart from installing the .Net 2.X Framework on your server, you’ll also need to get into the IIS setup and make sure it knows it’s now a 2.X application.

Other than that, pretty smooth. The one gotcha on my actual code was a custom button click routine that took the form QueryString and stripped out all the ASP.Net guff I didn’t want needed a bit of tweaking, as in .Net 2.0 there’s an extra __EVENTVALIDATION value. (My version is adapted from a article, and is used to produce tidy QueryStrings that can be bookmarked.)

Microsoft 2005 dev tool betas

To those who watch Microsoft’s dev tools, there are betas of the 2005 versions now available. MSDN subscribers can download full products straight away; others can order CDs, or stick to the Express products, which for trying out new languages, are quite nicely featured.

It’s a cunning strategy for Microsoft, helping to counter the proliferation of free programming languages such as Java and PHP by providing free development environments for ASP, VB, C#, C++ and their own (some would say mutated) J# implementation of Java.

MSDE, which has been around for years now, providing a royalty-free cut-down SQL Server, has been renamed SQL Server Express to show its heritage. (Well, its SQL Server heritage… most people know it grew out of Sybase, but that’s ancient history). Keeping it free thus helps fight off the MySql threat and allowing people for whom Access isn’t cutting it to be encouraged up to SQL Server).

Looking back 20 years to when I was growing up, trying out BASIC on my Commodore 64 or BBC Micro, I ponder how the next generation of programmers are getting hooked into this game. I suspect a mix of freebie entry-level products like this (and their counterparts from the world of open-source) is one way they can get involved. Which probably explains MS’s “Coding 4 Fun” web site.

ASP.Net first impressions

I’m enjoying mucking about with Asp.Net. For someone who’s done a fair bit of “Classic” ASP like myself, it’s a great step forward.

But maybe I’m way off the mark here, how on earth could they implement something as useful as a DataGrid HyperLink column or a <asp:hyperlink> tag and not include an easy way of setting the title attribute in the link? Nor does the syntax checker seem to recognise the <span> tag. Did the W3C go and depreciate these while I wasn’t looking? Don’t believe so…

(The solution for the DataGrid is to use an <ItemTemplate> and code it yourself.

Ditto the Hyperlink tag. For the <span> tag, well, what care I if the syntax checker puts a squiggly line underneath it and it shouts a warning during compilation. Ah, seems to allow <span> and other such niceties, you have to tell it your targetting IE5 (or later), rather than IE3/NS3. Makes sense.)