Quality Center API: Adding Requirements

I've been building a handy little requirement importer for Quality Center. It will read a Word doc, and let you specify the paragraph you want to start, and boom! Pumps them in. The API is, of course, is COM-based. I decided to write my app in .Net, and for grins, chose C# as my language.

For the most part, it's not been too tough to get it done, and the pain involved using Interop has been worth it given the power .Net puts in your hands. I gutted an old VB6 app I'd written in a hurry during a manual testing project I'd worked on earlier this year (blech).

I did run into an interesting snag, however. Quality Center objects, in a COM based environment (such as VB6), have a Fields collection that basically allow the coder to access the fields of the object via the Database table field names (the API is just about the thinnest wrapper around the DB I could imagine...but I won't get started criticizing its design here...OMG, is it bad!). In VB6, you'd access it like this:

AddReqVB6

In the .Net world, though, there isn't a Field method off the object. So, how does one get at the fields? I dug around deeply in the bowels (serious blech) of Hp/Mercury that was and found an old article that explains it very simply. I don't have the link handy (might post later if anyone is interested), but a picture is worth is a thousand words. Here's how you do it in .Net:

AddReqCSharp

Pretty easy when you know how.

«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456