DB2 / SQL SERVER 2005 / .NET

by Donn Felker 21. August 2007 14:17

db2Logo For those of you who are lucky enough to work with DB2 and .NET, you're probably already aware that you can run into some issues if you're  not using the correct DB2 Driver.

I've been writing some SSIS packages that move some data from a DB2 environment into a SQL Server 2005  dotnetlogoDatabase. I also had to write a few .NET applications that spoke to the DB2 database. Here's a couple drivers that I used and some of the notes regarding them. I've also included a few links that help in regards to development.

Drivers

 

  • IBM DB2 Driver for ODBC and CLI
    • Please note, I COULD NOT get the IBM web site to work with IE7. I had to use Firefox to download the file.  
      • Link Name: IBM DB2 Driver for ODBC and CLI
      • File Name: v9fp2_win_db2driver_for_odbc_cli.zip
    • Download the file, install and you'll have the drivers on your machine.
    • The thing is, this worked great for the BLOB/CLOB fields, but when the SSIS Package went to transform the DateTime fields it complained about data loss because DB2 has more DateTime precision than SQL Server 2005.
      • This was solved by using the Microsoft OLE DB2 Provider as it did not complain about the DateTime. The team I worked with knew that we'd lose some millionths of a second, but that was acceptable for the project. Basically the Microsoft Provider didn't complain about it like the DB2 provider did. The data came through the conversion correctly, so we were fine with it.

 

Other Useful Information/Tools

  • SQLState Error Message Reference
    • Sometimes SSIS can throw some nasty HRESULT errors your way and you're left scratching your head trying to figure out what went wrong. If the message includes a SQLState, look in this reference, it will probably be in here, or will point you in the right direction.

 

  • WinSQL Lite
    • I like to say its like the SQL Management Studio for DB2. A very nice GUI that allows you to interact with the DB2 system. A lot of "old schoolies" (as I call them) like to use the command line to hammer away at DB2. Me? I like to look at the GUI when I'm looking at tabular data. This tool will make your life 10 times easier when looking for data anomalies.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SQL Server

SQLyog MySQL GUI Tool

by Donn Felker 21. August 2007 10:06

I've always worked with UNIX, for years (on the side as a side project as well as for consulting). I've ran my own web servers, database servers, and I usually did this all through the command line. When I needed to use MySQL I either went command line or I went through phpMyAdmin. PhpMyAdmin is a great web interface for managing databases, but still, I always felt it was lacking in somewhat. It wasn't responsive and it was kind of "clunky" but it was still better than the command line.

Don't get me wrong, I love the command line for certain things, but sometimes when I need to look at tabular data, the command line isn't my tool of choice.

sqlyog

I recently ran into SQLyog, and I'm using the Community Version and I fell in love with it. The interface reminds me of old Query Analyzer from SQL 2000 and yonder, but its light years better than working with the web interface. I was able to get 10x as much work done with this tool at a client as compared to the command line. Again, I know there are MySQL super guru's out there who can smoke me on the command line, and I'm cool with that, but this is for the guy who likes the GUI and wants to get a few normal tasks done without having to memorize the entire MySQL Api.

If you work with MySQL at all this tool is worth looking at (if you haven't already).

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Outlook Live Mail Connector

by Donn Felker 17. August 2007 16:03

Microsoft just released something that's pretty cool, yet when I realized it wasnt EXACLTY what I wanted, it was a let down. MS released a connector that will allow Microsoft Office Outlook to connect to your Windows Live (Hotmail) account. (Download link at the bottom of post)

Using this you can:

  • Manage your Email
  • Manage your Live Contacts
  • Use advanced options for blocking junk e-mail
  • Manage multiple email accounts

If you drop some skrilla on a paid account you'll also get the following (which IMO, I think is BULL and should be included for free, hell Google gives you this stuff for free pretty much with Google Apps).

  • Manage Share and synchronize your Live Calendar in Outlook
  • Access your tasks and notes.

 

Will this connector make me drop GMail? Ummm, Nope. Will I still be called a "traitor" for being an MS developer but using Google Products, YULP. Don't get me wrong, I use TONS of MS Products, I just think GMail is on another level when it comes to free email. They've had my account since the beginning, back when Gmail accounts were on EBay for hundreds of dollars.

So far, its Gmail for me, mayne.

But... if you still want the connector...

Download it here

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Installing BlogEngine.NET on GoDaddy Shared Hosting

by Donn Felker 17. August 2007 09:14

benlogo80  gdLogo

I recently installed BlogEngine.NET on a GoDaddy.com shared deluxe Windows hosting account.  

After following the directions located on BlogEngine.NET's website I ran into a few problems.

Problems

  • Trust Level
    • The hosting account complained that I was trying to over ride a setting that was set at their Machine level for application Trust. Note: You cannot change the trust on GoDaddy hosting accounts (as far as I know).
  • App_Data Directory Permissions
    • You can upload the App_Data folder, but there is not a way to set the permissions on the folder (this folder needs Read/Write/Web access so that BlogEngine.NET can write to it).

Resolution

Here's how I installed BlogEngine.NET on a GoDaddy Shared Hosting account:

ASP.NET Set Up

  1. Log into your Hosting Account and go to the control panel.
  2. Go to Settings --> ASP.NET Runtime
  3. Ensure that the Runtime Version is set to 2.0.
    1. If not, select "Content Root" and then change it to 2.0. Click Continue.

 

[This next step is optional.]

Setting up The Blog in A Sub Folder (If you want to set up your blog on a sub directory like this: www.example.com/blog/ then you'll want to do follow these steps. If you want the blog to be your main URL such as www.example.com then skip this step).

  1. Return to the ASP.NET Runtime area of the hosting account (Steps outlined above).
  2. Click "Create Directory" and call it whatever you want, e.g. "blog"
  3. Set the settings of "Read", "Web", "Set Root" (this sets up the directory as a virtual directory)
  4. Click Continue to finish.

 

Setting Up the App_Data Folder

The App_Data folder needs to have write access enabled so BlogEngine.NET can do its work.

  1. Return to the ASP.NET Runtime area
    1. (If you've  decided to put your blog in a sub-folder, then select that folder name now)
  2. Click "Create Directory"
  3. Give it a name of "App_Data" with permissions of "Read", "Web", "Write"
  4. Click continue to finish.

 

BlogEngine.NET Configuration Setting Change

You will need to remove one line of configuration in the web.config file.

  1. Open the web.config file
  2. Find the line that has this in it: <trust level="High" />
  3. Remove that line
  4. Save and exit the file

 

Uploading Files to your site

Use your favorite FTP Client, I recommend FileZilla, to upload the files.

  1. Connect to your GoDaddy account with the FTP Client.
  2. Navigate to the folder in which you want to install the blog.
    1. If its a sub directory like "blog", go into the blog directory, otherwise if you want it as your main site landing page, use the home area which will usually be yoursitesname.com (or whatever your domain is)
  3. Copy all files EXCEPT FOR THE App_Data to the host. The App_Data folder should already be created (if not, then wait 5 minutes for Go Daddy's system to create the directory for you  - we did this in a previous step, but it can take a few minutes for the process to complete).
  4. After the files uploaded, go into the "App_Data" folder of your installation (on your local drive) and then upload all files and folders into the "App_Data" of the web site.

 

Now navigate to your site and finish with the regular installation

 

Contact Setup

This step I had to poke around to figure out...

You'll need a mail account with GoDaddy to set this up. Set up the mail account on GoDaddy (see their help for this)

  • Once a mail account is configured, go to your site, in the settings tab, and use the smtp adress of 'relay-hosting.secureserver.net'

 

Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Postponing .NET User Group Presentation

by Donn Felker 13. August 2007 12:25

Unfortunately due to some unforeseen circumstances recently I have had to reschedule the .NET User Group presentation I had scheduled for tomorrow night.

I apologize to anyone who was making plans to come see it. I will be rescheduling in the next couple of months. I will make another announcement when that date is secured.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SubVersion / TortoiseSVN Global Ignore Pattern

by Donn Felker 10. August 2007 08:51

tortoisesvn_logo_hor468x64

A nice feature of TortoiseSVN that is often ignored is the Global Ignore Pattern. It allows your Tortoise client to ignore certain file types during the check in/update process.

I've worked at a few companies  who actually check in everything, including the kitchen sink. The teams would check in all dll's, exe's, pdb's, bin folders, compiled web site folders, everything. In my opinion, those files should never be in source control (with  a few minor exceptions).

Reasoning

Source control is just that - "Source Control". Is that compiled dll for your business layer object really "source"? No, its a binary file that has compiled code in it. Is that PDB really a source file? No. Its a file that assists with debugging. Is that exe really a source file? No, its a compiled application. These SHOULD NOT be in your source control.

Exceptions

The exceptions to this rule are when you use third party components. For example, maybe  you use a product such as MBUnit, NCover, NDepend, or Infragistics. These are dll's that your application must reference to perform a certain duty. At this point, having a dll or exe in your source is completely fine (IMO).

How to set your global ignore pattern

To set your global ignore pattern (with TortoiseSVN) right click Windows Explorer --> TortoiseSVN --> Settings.

Tortoise1

 

Once you click  on settings enter your global ignore pattern.

Tortoise2

 

My Global Ignore  Pattern 

The global ignore pattern I use is: */bin */obj *.bak *.*scc *.user *.suo *.webinfo bin obj *.dll *.pdb *.exe

I'm blocking everything in my bin folder, obj folder, anything that may have been named *.bak, user files, suo files webinfo dll's and pdb and exe files.

If I need to check in a 3rd party component (which is rare). I'll remove the pattern, paste it into Notepad++ to save it temporarily. Then I'll check in the third party component by selecting it exclusively and checking it in.  Then I'll re-add my global ignore pattern.

Now your source control can be free and clear of code clutter.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Windsor Links

by Donn Felker 9. August 2007 12:01

windsor_rawlogo Every once in awhile I'll make a post that is for my own use, this happens to be one of them.

Ayende, put up a great post awhile back that I just bumped into. It has a bunch of good Windsor Container links/tutorials and he has labeled them as Windsor Patterns.

If you haven't used Windsor/MicroKernel for IoC, its best time you look into it. :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

DbDataReader Mishap

by Donn Felker 9. August 2007 11:51

This is something that I'm almost afraid to admit to. *sheepish grin*

I was debugging a DbDataReader Unit Test and all of a sudden it started to fail. After  about 5 minutes of thrashing I saw that I had put the DbDataReader object into the Watch window (which was not pinned -- therefore I could not see it). I was checking a value of the DbDataReader and working with it in the watch window. Well, I forgot to remove that watch, and as soon as the unit test started again, it bombed bout because as soon as the DbDataReader was available it attempted to perform some work on it (before the Read method was called). Therefore when we did call anything on the DbDataReader later in the game, it blew up because it had already thrown  an exception in the watch window.

Ooops. :)

Moral of the story: Make sure you delete your watch variables when you're done. Oops. :) Perhaps I should be using the Auto's window instead. :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Portable Applications - A Life Saver on a USB Stick

by Donn Felker 6. August 2007 00:09

Like many of you out there I'm straight up addicted to using Notepad++. If I can't use N++ I begin to have a productivity melt down. I have a ton of hot keys memorized, a bunch of formatters memorized, hell, it makes my life 10 times easier and I'm 10 times as productive with this tool. When its AWOL I feel, well, empty inside... Ok, not really... but you get the point. :)

There are times when  you're out at a client, or working on a server and you just need access to certain tools that are not normally accessible on the machine that you're working on. In consulting, this happens A LOT. Enter PortableApps.

Portable Apps allows you to put a lot of your common use applications onto a USB Stick so you can use them anywhere.

I have the following portable apps on my USB Stick:

You can choose from a list of apps on the site and build your own little custom set of programs. Here's what I do:

1. Create a folder called UTILS on your USB Stick

2. Create a folder called PORTABLE inside of the UTILS directory

3. Drop all the Portable apps into that directory and now you have a TON of great apps at your fingertips.

Caution though... not all apps run on all operating systems. Most apps will run, but check them here: Application Compatibility Page.

 

Furthering its use, you can even download the Application Suite which contains most of the above items listed as well as some others. The application suite gives you a nice little start menu type of interface and it even places itself in the task bar until you tell it to close. Once you have that running you can also install other portable apps into your application suite by visiting the applications page, downloading the app you want, and then choosing install from the options on the Application Suite.

Here is a shot of my portable app suite running on Vista Business.

portableappssuite

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Presenting at Arizona .NET User Group - Dependency Injection &amp; Inversion of Control

by Donn Felker 3. August 2007 10:06

I will be presenting at the AZ .NET User Group on August 14th. I'm going to cover how to use Dependency Injection along with Inversion of Control to decouple your applications. I will also demonstrate how these techniques can help ease unit testing.

When: August 14th

Time: 6pm

Location: Microsoft Corp 2929 N Central Ave # 1400 Phoenix, AZ 85012 (map).

See AZGROUPS.COM for more info.

See ya there!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  December 2008  >>
    MoTuWeThFrSaSu
    24252627282930
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    View posts in large calendar