Developer Frustration Day

by Codewiz51 February 26, 2010 20:30

Today was developer frustration day.

I've furnished a specialized DLL to my customer to provide input/output capability. The DLL reads CSV files and writes data to a relational database.

The entire development process has been frustrating. The input files aren't fixed and the folks writing the files I process apparently aren't writing to the same specification I am using. As a result, I've had to add a lot of exception handling code for things like inconsistent trailing commas, missing columns, columns with different names, etc.

I recently delivered the component to my customer along with source code. I was notified that errors were generated. Several hours later, I tracked down that the error wasn't in my code, but upstream.

The problem is, everyone believes it's the other guy's code that is broken. No one steps through the code with a debugger.  I am sure there is a lesson to be learned in this episode.  Maybe I'll figure it out in the future and publish another story.

I can say that my hat is off to the folks at Microsoft.  They are able to seemlessly handle items like additional commas when reading a CSV file.

Going nuts with SQL Server Compact Edition

by Codewiz51 February 20, 2010 17:22

I've been experimenting with converting a small Oracle database to SQL Server Compact Edition 3.5.  While I'm nonplussed with the available tools, in particular the lack of support for SQLCE in DTSWizard, the database is highly function for embedded purposes.

One thing that has been driving me nuts is a piped variable that VS 2008 places in the Settings variable for the path: DataDirectory. Your predefined connection string contains a term for Data Source that looks something like |DataDirectory|\EmbeddedAppDB.sdf.  The .Net runtime expands the term |DataDirectory| as follows:

  1. For applications placed in a directory on the user machine, this will be the app's (.exe) folder. (This means you will have to place your sdf file in the Release or Debug folders.)
  2. For apps running under ClickOnce, this will be a special data folder created by ClickOnce.
  3. For Web apps, this will be the App_Data folder.

I've found that you can place code similar to the following in your form load and class constructor to point the DataDirectory to the desired location:

// Declare a string and assign a database path.

string s = @"C:\MyDataDirectory";

// Assign the property to the current domain for the thread

AppDomain.CurrentDomain.SetData("DataDirectory", s);

// Now you can run Debug or Release without copying the DB.

this.contactsTableAdapter.Fill(this.embeddedAppDB.Contacts);

Using this code, you can place your database in a known location and use it without copying to each executable directory used by the IDE.

Note:

Generally, the following call to GetData returns null unless you set the value of DataDirectory:

// Assign the property value to a string.  Usually returns null
// unless you explicity set the value of Data Directory

string s = (string)AppDomain.CurrentDomain.GetData("DataDirectory");

Jane's 2009 Christmas videos with Rocket

by Codewiz51 February 14, 2010 22:25

Jane visited Fox Lair Farm New Years weekend, 2010. Jane is no longer riding and so, with a heavy heart, we are going to sell Rocket. I put together a play list of some of the video I took of her visit.

Sorry, no coding trivia tonight. I'm working on capturing family videos before our old Camcorders bite the dust.

This is an example of embedding a youtube playlist in a web page.  Sorry for the layout issues.  Everytime I save this entry, the layout gets punked on IE8.


<object width="480" height="385">
    <param name="movie" value="http://www.youtube.com/p/CC2028FA0A79919C&amp;hl=en_US&amp;fs=1"></param>
    <param name="allowFullScreen" value="true"></param>
    <param name="allowscriptaccess" value="always"></param>
    <embed src=http://www.youtube.com/p/CC2028FA0A79919C&amp;amp;hl=en_US&amp;amp;fs=1
        type="application/x-shockwave-flash"
        width="480" height="385" allowscriptaccess="always"
        allowfullscreen="true">
    </embed>
</object>

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant




Disclaimer

This blog represents my personal hobby, observations and views. It does not represent the views of my employer, clients, especially my wife, children, in-laws, clergy, the dog, the cats or my daughter's horse. In fact, I am not even sure it represents my views when I take the time to reread postings.

© Copyright 2008