The Cost/Benefit Ratio of Technology

Tuesday, June 09, 2009

I have been working on a demo version of a Web-based software application for employee time and attendance. The demo system duplicates the functionality for an ASP.Net application I had developed for a client last year. The purpose of the demo is to highlight how small businesses can get a great deal of benefit from straightforward information systems that are quite affordable yet can result in significant gains in productivity.

In order to make the demo work with multiple anonymous users - I moved as many SQL statements to stored procedures as possible - simple. I try to use "off-the-rack" controls where possible to reduce dependence on custom or third-party controls. For example, I use a SqlDataSource control for data access and for navigating among the saved time entries, I use a GridView control. The stored procedures worked well until I got to the "Update" procedure for changed entries.

The system generated a "Too many arguments" error that I couldn't figure out.

For hours I searched forums and blog entries trying to find a solution. I finally stumbled on one that I dismissed at first as being "too weird to be useful" but it ended up solving the problem.

(See http://forums.asp.net/t/1000526.aspx)

The approach calls for putting the following C# code in the Updating event of the SqlDataSource.

protected void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e)
{
DbParameterCollection CmdParams = e.Command.Parameters;
ParameterCollection UpdParams = ((SqlDataSourceView)sender).UpdateParameters;
Hashtable ht = new Hashtable();
foreach (Parameter UpdParam in UpdParams)
ht.Add(UpdParam.Name, true);
for (int i = 0; i < CmdParams.Count; i++)
{
if (!ht.Contains(CmdParams[i].ParameterName.Substring(1)))
CmdParams.Remove(CmdParams[i--]);
}
}

As my niece would have said, "Are you kidding me right now?"

This solution is so esoteric that I would have never come up with it on my own - and I've been developing software for 20 years!

As one who focuses on accounting and software, one of my goals is to help business owners use technology to address their accounting and business challenges.

When resolving programming problems takes up too much time, the cost/benefit ratio begins to be too heavily weighted on the cost side. This is one thing that stands in the way of small businesses in using technology efficiently to grow. Conclusion: The creators of programming tools have a lot more work ahead of them.