Sunday, May 02, 2004

blog is moving

As of today, May 2, 2004, my blog now lives here.

Saturday, May 01, 2004

Blogging and more

I'm in the process of setting up .Text on my server, but it's been a long day and it can wait.  I've been using Blogger, but it doesn't support some of the features I'm looking for.  I really like the idea of "tracebacks" and categories.

I also need to get my latest 'Stored Procedure Wrapper' template for CodeSmith uploaded. 

Tuesday, April 27, 2004

Let's talk about Word

Chris Pratley has a great post about the "life" of MS Word: Let's talk about Word

Monday, April 26, 2004

And on a different note: Metallica

I'm trying to burn a compilation CD of all my favorite Metallica songs, but it's proving to be tough. :-\  I may as well just carry all of my CDs with me.

So far (in no particular order):
Ain't my bitch
Wasting my hate
Nothing else matters
Damage Case
Stone Cold Crazy
Stone Dead Forever
Master of Puppets
All Within My Hands
Too Late Too Late

I realized today that I haven't ripped 'And Justice for all...' yet.  Geesh...I've owned the CD for years and I consider it to be their best album (although St. Anger is a close second).

A friend suggested that I look into buying an MP3 player for my car.  I should...I hate lugging CDs around.  I'd love to burn a couple hundred MP3s onto a CD and take it with me.  I may have to look into it.

Bugs in 'Stored Procedure Wrapper' template

Hehe...oops.  Because I was writing a template, I didn't start writing my unit tests until now.  The unit tests (using NUnit of course) are being written against my business objects.  Because of this, I'm now finding issues in my generated code.

More on this later...

CodeSmith template - DAL / Stored Proc wrapper

This really shouldn't be called a 'DAL', so I'm gonna start calling it my 'Stored Proc Wrapper' template instead.

Check it out.

This assumes the stored procedures are named as:

I created my stored procedures using the 'AllStoredProcedures' template that ships with CodeSmith.

It also assumes a class named 'Common' that contains a static ConnectionString attribute:

using System;
using Syste.Configuration;
public class Common {
public static string ConnectionString() {
get {return ConfigurationSettings.AppSettings["ConnectionString"];}

My app.config file looks like this:
<?xml version="1.0"?>
<add key="ConnectionString" value="put your valid connection string here"/>

Notice that I made all my 'Stored Procedure Wrapper' methods static. This way I can simply say:

DataSet ds = StoredProcedures.GetTable(ID);

Thursday, April 22, 2004

CodeSmith - still working on my DAL template

I'd say it's taken about 2-3 hours of dedicated time to write the template. Granted, a lot of that time has been spent a) waiting for the template to be compiled and b) looking up details in the Schema Explorer help file. CodeSmith is a great tool and I can definitely see using it on future projects.

My current DAL template is going to need some major refactoring, but that's no big deal. I'll try to post my template later today.

VS.NET Add-in/Macro contest

Roy Osherove is promoting a cool contest for the "most useful Add-in/Macro for Visual Studio.NET".  This looks very cool.  I need to come up with some cool ideas.... :-)

Wednesday, April 21, 2004

CodeSmith and my DAL

My original thought was to write a template for CodeSmith that would generate wrapper methods around all my stored procedures.  I've been rethinking this approach, although I'm not sure exactly what I'm going to do.

Anyway...I've been working on the CodeSmith template and I have a good start.  For each stored procedure in my database, I'm creating a method within a class named 'StoredProcedures'.  This class lives in my DataAccess namespace.  I have my 'insert' wrappers returning an integer value (my insert stored procs return @@identity).  My "select" wrappers return DataTables.  Updates and Deletes return void.  I'll probably include exception handlers in all of the methods.

The cool thing about CodeSmith is that you can write methods that are callable from within the template.  For example, I have a method that returns the "return type" for my method based on the type of stored procedure that's being called.  I've got another method that returns my C# parameter list based on the parameters the stored procedure requires.

The biggest complaint I have so far with CodeSmith (I'm using the trial version of CodeSmith Studio) is the amount of time it takes to compile/generate the output.  Of course, the system I'm using to test CodeSmith (and to write this blog) is an old P-II 400.  My laptop (a P-III 1.7 gHz) is sitting on my desk, but that would mean leaning forward to type. :-)

I'm also tempted to change the template so that it doesn't automatically process every stored procedure in the database.  I may change it so a single proc is processed.  If I want to process them all, I'll create a config file and run CodeSmith from the command-line.

ICCA - Detroit Chapter News

On Wednesday, April 14th, I was elected Vice President of the Detroit Chapter of the Independent Computer Consultants Association.  The chapter was established last year and since its inception, I've been responsible for the design/development/maintenance of the Chapter website.  My goal during my time as VP is to help grow our Chapter as much as possible.

Wednesday, April 14, 2004

VS.NET and why I could scream right now... resolution

What we had was a FUSER error...yep, a good old F'in User that screwed up.

Turns out, my app.config file was screwed up, but not by VS.NET.  It's amazing what you can find when you actually take the time.  My app.config file looked like:

<?xml version="1.0" encoding="uft-8"?>="BR"><configuration>
        <add key="ConnectionString" value=" value="valid connection string"/>

See the problem?  yep....the value="

Now that it's fixed, my form comes up fine. 

Live and learn I guess...

This page is powered by Blogger. Isn't yours?