SqlDataReader.HasRows Problems

For the last 6 years or so at work, we have had an intermittent bug. In this case, intermittent means around once in 6 months or so. A little background to the problem first: Our data access is done via what was originally Microsoft’s SQLHelper class, passing in a stored procedure (and parameters), and our entities use the reader to load all their properties. Pretty straight forward stuff. The problemis, on the live system, every few months a sproc will stop returning results, for no apparent reason....

October 30, 2012 · 2 min

Databinding to a DataGridView - The order of columns

A while ago I was writing a small history grid in one of our applications at work. It has a single HistoryItem object, which is fairly straightforward, something like this: Class HistoryItem { public int ID { get{ return _id; } } public DateTime CreateDate { get { return _createDate; } } public String Creator { get { return _creatorName; } } public String Note { get { return _note; } } } This was populated into a List<HistoryItem> and bound to the DataGridView directly:...

October 20, 2010 · 2 min

Multilining If statements conditions should be banned. now.

Multilining if statement conditions is bad. I was modifying some code and came across this: If String.IsNullOrEmpty(_selectedGUID) OrElse _ _selectedGUID = FeeAgreement.GetDefaultContractAgreementGuid OrElse _ _selectedGUID = FeeAgreement.DefaultPermAgreementGuid Then fgFeeAgreements.SetCellCheck(rowAdded, 0, CheckEnum.Checked) _selectedTitle = ag.Title _lastIndexRowSelected = rowAdded End If Which at a glance looks like this: Single Line If Variable Assignment Variable Assignment One person suggested that if someone had to do multiline the condition they could at least indent it....

March 24, 2010 · 2 min

Conflicting Unrelated Options: Alps Trackpad vs Microsoft Mouse

Usability. It’s one of those things that everyone wants, you know, stuff that ‘just works’. It’s nice when companies go out of their way to make things ‘just work’. It’s a shame Sony (and others, but I have a Sony, so it’s their fault for this exercise) decided to make things harder for me. Allow me to explain. I have a Sony Vaio (VGN-FE21M), which has an Alps touch pad, which like all touch pad has tapping enabled by default, and that I switch off straight away....

April 17, 2008 · 2 min

Vaio Event Service and Vista

When I first installed vista onto my laptop (a Sony Vaio VGN-FE21M) I also installed all the Sony stuff that I needed for it, mainly the VES (Vaio Event Service) and Control Panel, although there is a lot of other junk that they give you to install. In fact the first thing I did when I had the laptop new was to wipe MCE 2005 off it, and install XP Pro....

April 8, 2008 · 2 min

Flow Layout Panel and Scroll Wheel Problem

I came across a problem while writing an application for my parents today. If you have a FlowLayoutPanel on your form, and have many items in it, causing it to overflow and require scroll bars, you are unable to scroll the control’s content using the mouse wheel. This is somewhat trying in today’s applications, as nearly everyone has a mouse with a scroll wheel, or a track pad on their laptop with a scroll area....

March 29, 2008 · 1 min