Text

Reviving My Blog

Just a quick note that I’m reviving my neglected blog.

- Lari

Quote
"[T]he vast majority of programming jobs are in businesses where programmers are treated as glorified typists who know a special syntax. Much of the work is drudgery, infected by spaghetti legacy code or third-party software packages sold via the old school “steak & strippers” approach, colleagues and/or management doesn’t “get it,” little or no opportunity to grow professionally unless you do it on your own time, pay is remarkably meager in relation to the amount of skill the job putatively requires while the hours are expected to be long and job security is nearly non-existent. Projects are derailed, constantly late, interfered with or sabotaged.

To do better, career-wise, you pretty much have to be visible: write blog posts, publish code, learn obsessively in your own time, post on mailing lists, support newbies, speak at conferences, have super elite special skillz or be a known expert in some esoteric thing, and so on."

Amy Hoy

Text

Huh?

From MSDN - System.Data.ConnectionState :

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

yet

Note: The values in this enumeration are not designed to be used as a set of flags.

Huh? Then why did you give it a FlagsAttribute?

Text

Bizarre Format Recognized as DateTime by DateTime.TryParse()

In .Net 2.0:

So I had a situation where, given a string, I needed to know whether it was a date/time or not. Use DateTime.TryParse(), obviously.

This worked fine until we started feeding it strings in the form 111PM1 (three digits, “PM”, and another digit). These, it tells me, are really dates.

For example, ‘813PM4’ gets translated to ‘4/1/0813 12:00:00 PM’ and ‘023AM6’ gets translated to ‘6/1/0023 12:00:00 AM’.

Has anyone else ever seen dates in this format (YYYam/pmM)?

In the meantime, since we’ll never have 4 digits in the “year” position, I just make sure any “dates” are greater than 1/1/1000 before believing DateTime.TryParse(), which works for my situation.

Link

I’m trying this out for a situation where I need to evaluate expressions. If it works like the docs say it should, this will become one of my favorite libraries.

Update:

I did eventually go with FLEE, but ran into difficulties due to its need to know what types things are (that was awkward since I was feeding arbitrary values from a database record - they were coming back as object & wouldn’t compare with an integer). So I put in a kluge so that my functions that retrieved the data row values also cast/converted to the target type.

Not as pretty as I’d like but functional.

Text

How To Fix Dependency Could Not Be Found Errors For SSIS Script

Problem:

When you add a script task or component to an SSIS (Sql Server Integration Services) 2005 package, you get errors like: “The dependency ‘Microsoft.SqlServer.DtsMsg’ could not be found” (other namespaces are possible). These are typically Microsoft dlls that are present in the GAC, yet Sql Server/Visual Studio can’t find them.

Solution:

You have to copy the dll’s into the .Net Framework directory. This is complicated by the fact that the GAC, where you’ll find them, is hidden from Windows Explorer. Here’s how:

  1. Find your .Net Framework directory: (You can do this in Windows Explorer if you want.) Navigate to your windows folder (usually C:\windows), under that look for Microsoft.Net\Framework. Under that you’ll see several numbered directories - you’re looking for the largest 2.0 directory, eg, v2.0.50727. Note this full path.

  2. Bring up a command shell (aka DOS) window.

  3. Type
       dir /s <pattern>

    Where <pattern> is a pattern that should find the file you’re interested in, eg,
       dir /s dstmsg

    for the above error.


  4. Using the dir /s results for the source and the .Net Framework directory noted above for the destination, use a DOS copy command to copy the file into the .Net Framework folder.

I found this solution here: http://forums.microsoft.com/TechNet/ShowPost.aspx?PageIndex=1&SiteID=17&PageID=1&PostID=717965

Link

You could use System.Collections.Specialized.NameValueCollection, but only if both your names and values are Strings. Here’s how (click the title) if you need something a bit more general.