February 2004 - Posts

Case sensitivity!

Why don't more people use a case-sensitive SQL Server? I was installing the latest 1.x version of DotNetNuke and had some database problems. I found the database create scripts in the "database" subdirectory and decided I'd run them individually and see if anything pops up. It sure did! This code only works on a case-insensitive database. If your database is case-sensitive, the scripts fail. Why? How hard is it to write it against a case-sensitive database? That will guarantee that it will run on either one.

Very frustrating. I recall having the same problem when playing around with setting up a database for managing ASP.NET session state. Arghh!

Posted by PSteele | 7 comment(s)

Oracle and data types

Today I was working on a factory class for database abstraction since the project I'm working on needs to support both SQL Server and Oracle. I had previously prototyped with Microsoft's .NET provider for Oracle but have switched to Oracle's ODP.NET data provider. When running my unit tests on the converted code I hit an error when creating an OracleParameter:

new OracleParameter(parameterName, parameterType)

The parameterName was a string and the parameterType was System.Data.DbType. Unfortunately, Oracle decided to create their own dbType enumeration (OracleDbType) so the above code no longer works (Grrrr!!!). I was intially frustrated and the thought of having to map the System.Data.DbType parameter to an OracelDbType parameter but there was an easier way: The OracleParameter class exposes a DbType property that accepts a System.Data.DbType. So I changed the code to:

OracleParameter p = new OracleParameter();
p.ParameterName = parameterName;
p.DbType = parameterType;

Now I don't need to do the mapping!

Posted by PSteele | 4 comment(s)

Next GANG Meeting

The next Great Lakes Area .NET Users Group (GANG) meeting will be held tomorrow, Feb. 18th at the Microsoft offices in Southfield, MI.

Tomorrow's topic is "eoStar : a study in .NET Application development" with Michael Rutherford presenting. This talk covers the successes and pitfalls encountered along the way to a re-invented application. Discussions relate to program architecture, implementation, deployment and support, as well as: PocketPC, SQL, Web Services, and Windows Forms. Learn how a small set of skilled developers can take a well-established code base and re-write an enhanced version in C#. This talk provides a fascinating look behind the scenes at the power and potential of .NET.

Posted by PSteele | with no comments

Why strong name an assembly?

DevelopMentor's Richard Blewett has posted an excellent set of bullet-points on some of the benefits of strong-naming an assembly.

Also, don't miss Brent Rector's follow-up on "protection" vs. "detection".

Posted by PSteele | 2 comment(s)

Integrating WinForms with VB6

I wanted to add a dialog to an existing VB6 application, but I wanted to use some of the features of .NET (anchoring, docking, etc...). With COM-interop, I thought it would be pretty easy. For a test, I whipped up a super-quick WinForms app, but changed the output type from "Windows Application" to a "Class Library". I ran REGASM on the DLL to expose it to COM then placed it in the GAC. A few quick lines of VB6 code instantiated and ran the form:

Set winForm = CreateObject("Sample.Form1")
winForm.Text = "VB6 Caption Setting"
winForm.ShowDialog

Success! Worked like a charm. Before declaring victory, I wanted to try a few things. I removed it from the GAC, unregistered it and made my changes in VS.NET. Re-compiled, re-registered and re-placed it in the GAC. Ran the VB6 app and the old version of the form showed up! Hmmmm... I re-checked the DLL to make sure I had re-compiled it -- I had. I tried removing it from the GAC, unregistering and re-registering and re-adding it to the GAC. The VB6 still ran the original version. After playing around with this process for a while, I tried shutting down the VB6 IDE and re-starting it. When I ran the VB6 sample code, the correct version of the form popped up.

I haven't dug into the details of what's going on, but my guess is that the AppDomain that started up the first form was loaded by the VB6 IDE. Even though the VB6 application I was developing shut down, the IDE didn't so the AppDomain remained loaded -- along with my Form. When I tried to create the object the second time, the type was already loaded in the AppDomain from the first time I ran it. This means I saw the old version of the form.

I'm going to see if I can force the AppDomain to unload when the form closes. This, of course, won't be necessary in production, but will help me out when prototyping.

Posted by PSteele | 3 comment(s)

What?! Win2k & NT4 Source Code Leaked?

Exclusive: Windows 2000 & Windows NT 4 Source Code Leaks

Anyone else hear anything on this?

Update: By the way, No -- I don't believe this. It's coming from a site with the title "Where unprofessional jounalism looks better."...

Posted by PSteele | 9 comment(s)

Invalid PInvoke Metadata!

I was writing some new unit tests last night. I hadn't run the nUnit GUI since upgrading to VS.NET 2003 (and the 1.1 framework). When running a test that was connecting to a SQL Server, I got a wierd error:

Invalid PInvoke Metadata

A quick google search provided the answer. You need to add the following to your NUnit GUI config file:

<?xml version ="1.0"?>
<configuration>
    <startup>
        <supportedRuntime version="v1.1.4322" />
    </startup>
</configuration>
Posted by PSteele | 2 comment(s)

Finally! Star Wars on DVD!

The Star Wars Trilogy on DVD to be released on September 21st.

Star Wars Episode IV: A New Hope, Episode V: The Empire Strikes Back and Episode VI: Return of the Jedi will be available in a four-disc set that includes a bonus disc filled with all-new special features -- including the most comprehensive feature-length documentary ever produced about the Star Wars saga and never-before-seen footage from the making of all three films. Each of the three films in the Star Wars Trilogy has been digitally restored and re-mastered by THX for superior sound and picture quality.
Posted by PSteele | 2 comment(s)

Last Day for DevDays Early Bird Registration

That's right -- today is the last day to register for DevDays 2004 and receive the discounted $75 rate as well as a FREE Developer Welcome Kit. I'll be at the DevDays in Detroit manning the GANG user group booth in between sessions. Hope to see all local .NET developers there!

Posted by PSteele | with no comments

Feeding the lawn?

So I'm working on a design document for a class. I hit F7 to check my spelling and grammar and it seems Word wants to change my "Serializable" class to a "Fertilizable" class. No thanks. I'll just add "Serializable" to my dictionary... :)

Posted by PSteele | with no comments
More Posts Next page »