Software

Overwriting an Excel file destination using SSIS

This was a problem I racked my brains over for a while when I first started using SSIS. I found a few possible including using a File System task to copy a “Template” Excel file over the existing on, or generating unique files by appending the date.  I simply wanted to overwrite the existing data just like the Flat File Destination gives you that option.

My work around was as flows:

Create the Data flow the way you normally would, then go to the Control View Then add two Execute SQL Tasks before your data flow is called so it looks like this

Step 1: Add Execute SQL Task 1 to Control Flow

Step 1: Add Execute SQL Task 1 to Control Flow

Set both Execute SQL Tasks to use the Excel file

Step 2: Set Connection Manager

Step 2: Set Connection Manager

Set your first Execute SQL Task’s SQL Command drop your table which is also known as the sheet name of your Excel file.

Step 3: Drop Table

Step 3: Drop Table

Repeat step 3 on the second Execute SQL Command this time create your tables.

That’s it. Good luck.

Tags: , , , ,

C# .NET and LyricWiki to lookup lyrics

Music is everywhere with today’s high speed internet is most home it is no wonder that music is even moving to the World Wide Web. Many radio stations allow you to stream their stations over the internet. Many websites have been developed around music, like www.jango.com, www.pandora.com, and www.last.fm. I recently released my second version of Jango Desktop and one of the features I implemented was the ability to look up lyrics. Before I started I was thinking about all the ways I could parse the lyrics out of an existing lyric’s websites database. During my searching I stumbled upon http://lyricwiki.org/. Here is a small description of LyricWiki from the website:

LyricWiki is a free site which is a source where anyone can go to get reliable lyrics for any song, from any artist, without being hammered by invasive ads.

At this point you are probably thinking to yourself the same thing I did “Great, but where do I start?” So today I am writing a step by step tutorial on how to use Lyric wiki in your .NET program.

Creating a simple lyric demo program:

Step 1 Create the Form

Step 1: Create the Form

Open visual studio and setup your form to look similar to mine.

Adding the web service:

Because LyricWiki offers a web service, you will want to add it to your program as a web reference. Right click on your solution and select add a web reference, or in .net 3.5 add a service reference -> then go to advance and add a web reference. The service’s URL is http://lyricwiki.org/server.php?wsdl you will want to add it like below if you press go you should see the available methods.

Adding a Web Reference

Adding a Web Reference

Writing the code:

Double click on your button on the form and let’s right some code to handle the lookup.

Add this to the top of your code:


using LyricsLookup.org.lyricwiki;

Then add this to the button clicked method:


private void LyricsButton_Click(object sender, EventArgs e)

{

LyricWiki wiki = new LyricWiki();

LyricsResult result;

string artist = artistTextBox.Text;

string song =   SongTextBox.Text;

if(wiki.checkSongExists(artist,song))

{

result = wiki.getSong(artist, song);

Encoding iso8859 = Encoding.GetEncoding("ISO-8859-1");

LyricsRichTextBox.Text = Encoding.UTF8.GetString(iso8859.GetBytes(result.lyrics));

}else{

StatusLabel.Text = "Lyrics not found in database";

}

}

Then run and test.

Download the full solution of LyricsLookup

Tags: , , ,

Making Netgear SC101 Work with Vista SP1

So you my have noticed that if you upgraded to Vista or have Vista that it took Netgear over 6 months to release drivers for there Zetera SC101 NAS.

 The Problem:

When installing the latest SCM utility and drivers you receive an error “Failed to install the Z-SAN SCSI miniport driver”  or similar.

 The Resolution:
If your installation already failed and the setup software tells you to restart, you must do so.

Next restart the installation. Select Customchange the default installation directory to anything but the default and then continue. The software should install perfectly now.

You can get the latest software from Netgear’s support page.

This fix came from scouring the comments from
 http://www.kowitz.net/archive/2007/09/11/netgear-sc101-finally-does-vista.aspx

Tags: , ,

Tuesday, September 30th, 2008 Software, Tech Support No Comments

Sick of Pidgin’s Look and Feel

Pidgin LogoPidgin is a multi-protocol Instant Messaging client that allows you to use all of your IM accounts at once. It can be found at http://pidgin.im/ I have been using it for a while now when AIM started putting advertisements into there software. Pidgin was formally GAIM which changed its name due to legal reasons and started to rewrite their software. My friends and I have been using it for a while now and really enjoy it. However there is one complaint I hear a lot and that has to do with appearance and themes. It is for this reason that I am putting together a little guide of steps I have taken to make pidgin more my style.

The Original Buddy list is depicted below.

Orginial Buddy List

One thing that I do not like is that the icons each name takes up so much space. This is because the idle time and buddy information is being displayed under each buddy name. I started by disabling this feature.

  1. Go to buddies
  2. Show and un check buddy details, idle times and enable protocol icons to a style of your liking.

pidgin2

By doing this I can easily see more buddies online at any given moment, my buddy list looks something like and all those details I disabled are still available just by hovering over a buddy with my mouse.

Pidgin 3

Another complaint I often here is the lack of themes. Well actually there is support for themes. I will admit its a little hidden, but I am going to walk you though it now and show you where you can find hundreds of free themes.

  1. Pidgin uses the GTK+ orThe GIMP Toolkit for creating its graphical user interfaces. This is because it is cross platform and so is Pidgin. While my tutorial is geared towards windows users I am sure its very similar to other operating systems.
  2. We need to start by enabling GTK+ control in pidgin. To do that go to Tools > Plugins> and check Pidgin GTK+ Theme Control.

    ThemeControl

  3. Press Configure Plugin.

    Pidgin6

  4. Everytime you change your theme press Re-read gtkrc files to apply the theme.
  5. To select a new theme go to Start > All Programs > GTK+ > Theme Selector. Select a theme and press ok, then Re-Read gtkrc files to see the theme applied to Pidgin.
  6. Download new themes at http://art.gnome.org/themes/gtk2/
  7. Unzip themes and store them in the C:\Program Files\Common Files\GTK\2.0\share\themes folder.
  8. I used the Litoral theme, without spending hours searching.
  9. Make sure you adjust the GTK+ Interface Font so it looks good with your theme. I ended up using Arial normal styles size 10.
  10. Now chagning the Pidgin default icons, by default they are located in C:\Program Files\Pidgin\pixmaps\pidgin
  11. I started picking an Icon set I liked. I found a few pre-made sets with some Google searches here some links

Make sure Pidgin is not running when you make this change and make sure you backup your original icons. If you can not find any you like, you can Google search for more or make your own.

* Originally found on this forum

I settled on the Glossy Theme

Pidgin Final

In the end my pidgin looks a little something like this, I plan on tweaking it out some more though, I will keep you posted. If this post helped you in anyway please leave a comment and let me know.

Tags: , , , ,

Saturday, February 16th, 2008 Instant Messaging, Software 18 Comments