C# vs VB.NET

Recently my co-worker and I we’re discussing the use of C# for all future development on Task Factory. His reasoning made sense in that he said that most developers (including Microsoft employees and newbies) are overwhelmingly using C# vs VB.NET. Currently Task Factory is written in mostly VB.NET with the SCD component written in C#. To me, there isn’t that big of a difference between the two. Usually C# is ahead of the VB.NET team by about a year on new features but other than that, same thing.

Of course the syntax is different but they both use the same .NET libraries and both compile down to IL.

To me, I couldn’t care less about what language we develop Task Factory in. I’ve written applications in both C# and VB.NET and I can switch between the two very easily.

We got on the subject of how funny it is that some developers will “frown” when you tell them they have to develop in VB.NET. I never understood that. Like C# is this magical language and VB.NET is a script kiddie language. I always get a chuckle out of developers are adamant about using one language over the other. If you do a quick search on on one of the search engines for VB.net vs C# you’ll quickly see what I mean.

Some say C# just feels more “solid” because of the history of vb and vbscript. Some say VB.NET makes a lot more sense to them because of the use of curly braces in C#. One C# purist said that VB.NET doesn’t feel “complete”. As if Microsoft would ever put out any product that isn’t “complete”. Oh wait… :-)

I say they’re both wrong. Both languages are so easy to work with that you really have no excuse as a .NET developer to not know both languages. I learned C# in one week. Yep, no lie. It’s that easy. I read Jessie Liberty’s Programming C# book over a week long vacation and started writing C# programs the next week.

Here is a REALLY great overview of C# vs VB.NET that goes over 24 different sections of both languages and shows you the difference between the two languages.

So my suggestion to you purists out there is that you stop bickering about “What language is better” and learn both. You’ll be a more “solid” programmer for it.

Upgrading SSIS Custom Components to 2012

Recently we had to upgrade all of our components in Task Factory to utilize the new 2012 SSIS assemblies for integration into SQL 2012. I learned a couple of things along the way that you should know about if you’re doing the same.

Even though Parameters are available using the Variables class (i.e. $Project::MyFile), they cannot be written to from the Variables class. Meaning Variables(“$Project::MyFile”).Value = “C:\ssis\test.xml” will fail.

Parameters cannot be written to within a Task but can be within a PipelineComponent. The reason for this is PipelineComponent has a reference to the Parameters class whereas the Task class does not. You can only access Parameters from the Variables class in a Task.

All Parameters are available for both the Project and Package level parameters within the Variables collection. Meaning if you list all of your variables, they will be part of the Variables collection. The namespace for the parameters available in the Variables collection is either $Project or $Package

There isn’t a need to “Choose Items” for new Control Flow and Data Flow tasks. If you put them in the correct location of %programfiles%\Microsoft SQL Server\110\Dts\Tasks and %programfiles%\Microsoft SQL Server\110\Dts\PipelineComponents, they will automatically show up in the SSIS Toolbox.

You will not have to change very much of your code to get your components to work in SQL 2012. All of the interfaces are the same for both Tasks and PipelineComponents. You WILL have to add references to the SQL 2012 assemblies like Microsoft.SqlServer.DTSPipelineWrap and Microsoft.SqlServer.DTSRuntimeWrap.

You will need to use .NET 4.0 for SQL 2012 Tasks and PipelineComponents as well as use GACUTIL from .NET 4.0 to add the assemblies to the GAC. GACUTIL for .NET 4.0 is usually located in %programfiles%\Microsoft SDKs\Windows\v7.0a\.NETFX 4.0 Tools\.

That’s it for now. I will update this as we continue to build Task Factory for SQL 2012.

Job Recruiters and Their Emails

Recently I made the mistake of updated my resume on Monster.com. A recruiter alerted me to the fact that I hadn’t updated my resume since 2009. Which makes sense. That was when I started with PragmaticWorks. I recently finished a book so I decided to add that to my resume. I completely forgot that as soon as you update your resume, you’ll be inundated with emails and phone calls. I’m not saying that’s a bad thing. To be wanted in a professional (and personal) level is a great feeling. That said, I’m not going anywhere, anytime soon. I have it quite good with Pragmatic Works.

In any case, a reocurring theme I’ve noticed recruiters is I don’t think any of them have had any basic sales training. Nor have I but I’ve studied sales, copywriting, seo, etc because it makes me a more valuable asset to my company. It seems that recruiters don’t understand simple things like the word “You” vs “I”. If I see “I” more than “You” in the opening email to me, it seems that you are trying to help yourself, not me. Here’s an example:

“I found your resume on Monster and I feel you would be a good fit for the position below. Could you please review the job description below and either email me or call me back?”

So what’s wrong with this? There are 4 reference to I and me and 3 references to “you”. It’s a template. They didn’t take the time to make it personal, make it about me. I mean, if I decide to go to work for this guy he’s going to make a pretty nice chunk of change. I know, PragmaticWorks has a recruiting department. We make a LOT of money placing someone. So how SHOULD he have opened the email to entice me to at least respond?

“Hi Chris. I’m Rob. Your resume made it across my desk this morning and based on your skillset, you appear to be a perfect match for an opening our client is looking for. The company is looking for a developer like you with a strong background in VB.NET, SQL Server and SSIS. If you’d be open to a quick 5 minute call, I’d appreciate the opportunity to talk with you about this position and whether you would be a good fit or not”

Everything here is non-threatening. He’s not saying “You look good, let me make some money off of you”. He’s saying “I have an opening, not sure if you’d be a good fit but I’d at least like the opportunity to talk with you”.

Basic stuff here folks. Don’t send recruits templated emails. Take the time to craft a decent, personal email and the response rate will be much higher.

That said, some of the guys have been doing exactly what I said here. But it’s 1 out of 8.

New Release of Task Factory

Sorry for the lack of updates. In the middle of developing some of the most advanced components we’ve ever tackled with Task Factory, I just released the latest version of Task Factory. This release includes a BUNCH of updates to the current components and includes three new components.

The three new components are Download File Task, Advanced Execute Package Task and Advanced Execute Process Task.

Download File Task is used to download files using HTTP rather than FTP.

Advanced Execute Package Task allows you to execute a child package while passing and retrieving variables to and from the child package. This makes it WAY easier than setting up a Parent Configuration to pass variables to the child package.

Advanced Execute Process Task allows you to execute multiple processes per instance of the task. It acts as if you’re executing the processes from the command line and allows for variable replacement as part of the command being executed.

While this release was important to fix some bugs in TF and release a few new tasks, the upcoming release (in about 6 weeks) is going to blow you away. The sheer power of the tasks we’re adding now is incredible.

Positive Psychology – Shawn Achor

I just watched a video on Positive Psychology by Shawn Achor. Achor is a Harvard researcher who has studied the effect on how business is effected by your level of happiness. It’s a REALLY interesting talk because it shows that happiness is not simply attained by achieving your goals because goals are ever changing. Meaning that once you hit 100k in sales, you’ll want 150k. His assertion is that you need to be happy BEFORE attaining your goals.

Check it out:

 

One of his methods of achieving happiness before reaching your goals is a daily gratitude journal as well as keeping a journal about one positive experience you had that day. So I’m going to start one here for the next 21 days.

Why is my computer running so slow?

So for the past few months my development machine has been running like dog crap. I couldn’t, for the life of me figure out why this was happening. I downloaded ProcessExplorer… Nothing too bad. Memory is being used up efficiently, nothing is dogging my CPU. What…the…hell!

Quite by accident I figured out what the issue was… My web browsers. Yep. Seems that ole Firefox OR Chrome decided to make my machine as inefficient as possible. Now, don’t get me wrong, they can’t take ALL the blame. I also blame 80% of the issue on adobe flash. I’m starting to see why flash and apple are battling against each other. What a horribly inefficient piece of crap flash is.

So I decided to do an unscientific test. I timed how long it took my machine to compile an 8 project application in Visual Studio with and without Chrome running. Then I tried the same scenario after I watched a video on youtube. Anyone want to guess? At LEAST twice as long to compile after watching a flash video.

I’ve tried IE (but haven’t used it in years) and Opera but I don’t like those browsers all that much. As it is now, I no longer use a web browser on my dev machine. I now use another laptop on my desk for streaming pandora, watching tutorials or anything else that requires flash.

So… If your machine is running slow, take a look at your web browsers as a source of frustration.

Using GetPackagesInfos2

Recently I was creating the Advanced Execute Package task for Task Factory. One of the ways to retrieve a list of packages from SSIS is by using the GetPackageInfos method. However, the problem with GetPackageInfos is that it requires you to pass in a username and password. With the use of an OLEDB or ADO SSIS connection manager, this isn’t possible. You can grab the username from the SSIS connection manager connection string but you cannot retrieve the password. In comes GetPackageInfos2 which is an undocumented (of course it is!) way of retrieving packages from the MSDB server. The function signature for GetPackageInfos2 is:

Public Function GetPackageInfos2 ( _
	strFolder As String, _
	connectionObject As Object _
) As PackageInfos

Notice the second parameter is an Object type? Yeah, uh… good luck finding out what it is on your own. Fortunately I figured it out and was able to use it in my project… and so that you can just read this blog and not waste a few hours looking for an answer.

Turns out the connectionObject parameter is looking for an SSIS connection manager object. So to get the GetPackageInfos2 to work you simply grab a reference to a connection manager and pass the connection manager object into the function. mConnections is an a Microsoft.SqlServer.Dts.Runtime.Connections object.

Dim app As New Microsoft.SqlServer.Dts.Runtime.Application
Dim cm As Microsoft.SqlServer.Dts.Runtime.ConnectionManager = mConnections("MyConnectionManager")
' pass in the root folder of "/"
Dim packages As Microsoft.SqlServer.Dts.Runtime.PackageInfos = app.GetPackageInfos2("/", cm)

For Each package as PackageInfo in packages
     Console.Writeline(package.Name)
Next

So it’s as simple as that. Grab the connection manager reference from an OLEDB or ADO.NET connection managers, pass it into GetPackageInfos2 and you got your reference.

Leave a comment if you have any questions.

GoDaddy… Come on man!

If you’ve inexplicitely ever sat through an episode of ESPN’s NFL round table discussion shows you’re probably aware of the “Come on man” segments. If not, the basis is the commentators see an NFL player, owner, fans, ref, etc do something stupid and they call them out on their stupidity. It’s pretty funny sometimes, other times… not so much. Today I have my own come on man.

Come on Godaddy.com!

This particular feature of Godaddy.com has been bugging the hell out of me lately. I’ll go and search on their home page for a domain to see if it’s available. Instead of automatically removing http or www they decided to be lazy and let you fix issues with your query rather than trying to adjust it themselves. Here’s an example.

I went to godaddy’s home page and entered in www.rocksthoughts.com in the textbox for “Search for a domain”.

 

When I pressed the “GO” button this was the error message I received on the next page:

So basically they are saying “Hey, we know what you did but we’re too lazy to fix it”. Seriously… It’s not that hard to either REMOVE the www. or use a regular expression to look for it.

In fact, here’s some code for ONLY looking at the domain.

I mean a very easy way to solve that is:

Dim url As String = UrlTextbox.Text
 
If url.StartsWith("www.") Then
    url = url.Replace("www.", "") 
End If

 

I’m just not sure why that error exists. Am I missing something or are the Godaddy engineers being lazy here?

Book chapters complete

My Book

I was lucky enough to be invited to write some chapters for the upcoming Professional SQL Server Integration services book. This was a very unique experience unlike anything I’ve ever done before. I’ve never had someone really judge my writing skills (or lack thereof) before. So to have someone judge almost every sentence I wrote was very weird. I’m sort of glad that I can get away with writing code that doesn’t have to be judged line by line (well, except code reviews). That said, I had fun doing it and now I get to put that on my resume. Having a book published by Wrox is a pretty significant career and resume booster.

My chapters in the book cover the programming side of SSIS in terms of writing custom components. In essence they will be the chapters that most BI developers skip right over but programmers will read. Not many BI Developers I know are all that interested in writing custom components. They prefer to write script tasks and components to do what they need. I have to agree with them for the most part but the problem with script tasks and components is the lack of re-usability. If they need to use the same code base again they basically have to copy and paste it over and over again. Which sucks. So my chapters cover the pain staking task of creating custom components that can be used in any ssis package they create without copy and paste. Yes, it is quite a pain to create them. I do it every day writing Task Factory.

While I liked the experience of writing this book it’s one of those things you have to try to see if you like it for yourself. It was never fun having the Technical Editor remind me that I forgot essential parts of SSIS in 2012 and having to go spend hours / days learning new undocumented classes. Anyone who’s ever had to cry their way through writing code with undocumented Microsoft classes knows the pain I was in.

Was it worth it? Absolutely! While I won’t be spending time in France having Gertrude Stein review my work, I’m pretty proud of this accomplishment. I do, however, look forward to spending time in a local starbucks. Maybe at some point, when I visit Charleston, with my buddy Patrick Riddle.

 

Hello World!

When you install a wordpress blog the first post is always “Hello world!”. I’ve probably put together 50 websites in the past few years with wordpress and always delete the “Hello world” post. Because for the most part it’s not relevant to the site’s content. But this time I’m leaving it. It’s truly, Hello world for me. Well, really, hello world again…

A few years ago I had a pretty nice blog going on RocksThoughts.com. I had lots of code examples and generally a lot of good information about writing software. But as is often the case, (A.D.D. anyone?) I forgot about the blog and moved on to other projects. I was getting quite a few hits to the site and looking back I could have monetized the site for a nice monthly recurring income. The reason I didn’t do it then is because I didn’t know what I didn’t know. I was writing about cool stuff I found. I’m hoping to the same now.

SQUIRREL!!! (A.D.D. again). Seriously I walked away from writing this post for 45 minutes. I’d take a drug to control it but I hate prescription drugs. Anyways…

The one area I struggled with last time was writing about coding. I love coding but it’s only 20% of my life. Why should I write a full blog on 20% of my life. So this new blog will be about coding, websites, seo, sem, homebrew, family stuff, vacations, etc.

I’m not really writing for a specific audience and I doubt too many people will read this but I don’t really care all that much. It’s a place where I can write what I want (within reason) and have fun with it.

At this point if you’re still reading, that’s awesome. Congrats to you and hope you stick around for more.