Friday, March 31, 2006

Databinding Confusion

WARNING: This is a purely techie-post for the benefit of some poor sap like me who has yet to discover the strange behavior that I have just found in Visual Basic 2005 Express Edition.

I used the databinding form wizard to create some forms in vb 2005, which automatically provides a BindingSource, a BindingNavigator and a TableAdapter bound to your DataSet.
The BindingNavigator is controlled by a wizard-generated toolstrip, which contains the standard data-navigational buttons; movenext, moveprevious, movefirst, movelast, addnew, save and delete.
The save button calls a validate, endedit and update methods in order to commit your data to the data store.
What I found is that attempting to AddNew and then changing your mind and clicking MovePrevious results in an error which complains that you've tried to enter a null value where it doesn't belong. Actually, you intended to abandon the null values and let them go away. However, somewhere they are fighting to live; in code that Visual Studio won't let you see, the bindingnavigator, or the tableadapter is screaming "Take these null values or DIE!!!" To which the DataSet blythley responds. "Nuh-uh."
As it turns out there is a simple remedy, though finding it cost me some of my youth.
When someone tries to move off of a new or edited record, you can give them a final chance to decide what they mean to do by presenting them the options to Save, Abandon, or Don't Move using code like the following:


Private Sub BindingNavigatorMovePreviousItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorMovePreviousItem.Click
Try
Dim yesno As MsgBoxResult
yesno = MsgBox("Do you want to save the edits you made to this record before moving?", MsgBoxStyle.YesNoCancel)
Select Case yesno
Case MsgBoxResult.Yes
Me.TblClientsBindingNavigator.Validate()
Me.TblClientsBindingNavigator.Update()
Case MsgBoxResult.No
Me.TblClientsBindingSource.CancelEdit()
Case MsgBoxResult.Cancel
Exit Sub
End Select
Catch ex As Exception

End Try
End Sub


It is the CancelEdit() method that tames the shrewlike tableadapter. I wish I knew how, but for now I only thank heaven that the screaming has subsided.

Sunday, March 26, 2006

New Piano

We were given a wonderful piano by Heidi's aunt & uncle. Everyone is really enjoying it; the sound resonates nicely in our plaster and tile-coated interior. Arthur's idle plinking is enough to generate exotic ambience.
I've been burying myself in work in an attempt to gain a higher level of proficiency with .NET 2.0 technologies. I'm making progress, but it feels maddeningly slow. It seems like I do everything three different ways before I settle on a technique that really works.
For excercise, I've been walkimg more; yesterday, up to the neighbor's house to ask for access to some cow-pies. He waved me on encouragingly, with a magnanimous, sweeping gesture, which seemed to suggest "take as much as you can carry". I was able to procure some patties of just the right age with very little trouble. My plan was to collect most of a bucket full of worm-filled cow-pies to seed our new worm-bin with. However, the cow began showing undue interest in me. I don't care how docile an animal is supposed to be, when it weighs that much, I just can't relax until I'm on the "safe" side of the fence.
So, the 5 or so worms that I collected will have a little worm-topia all to themselves for a while. That is, until they breed and it becomes a worm-tropolis.
So that was my walk.
Then, I hacked on some blackberry vines. But by-and-large, I need a LOT more exercise.

Friday, March 24, 2006

DIY Geek-Style

instructables.com has some unusual do-it-yourself projects. The projects seem to be very cool at first, and then the amount of work and technical skill seems to outweigh the rewards. However, I would be keen to see some of these projects turn into products one could buy impulsively.
Animated pac-man chasing ghost in the spokes of a bicycle. This I would love to have, but I certainly won't be making it for myself any time soon.

Tuesday, March 21, 2006

Artificial Sweeteners

Lately I've noticed a lot of products containing Splenda (aka sucralose) on the store shelves. Not wishing to spend 5-10 years ingesting something only to find out it is toxic, I decided to Google sucralose. My findings are not conclusive, but I feel there are enough parallels to Aspartame, which I think has certainly been shown to be dangerous, to warrant avoiding sucralose altogether.
Here are my assertions:
  • The artificial sweetener landscape is highly irrational.
  • The most popular sweeteners are not safe.
  • The safest sweeteners are not popular.
Here is the page I'm citing (there are more, but this one had it all in one place):
http://www.womentowomen.com/nutritionandweightloss/splenda.asp?id=1&campaignno=artificialsweeteners&adgroup=splenda&keywords=sucralose

Aspartame/NutraSweet

Aspartame, the main ingredient in Equal and NutraSweet, is responsible for the most serious cases of poisoning, because the body actually digests it. Aspartame should be avoided by most women, but particularly in those with neuropsychiatric concerns. Recent studies in Europe show that aspartame use can result in an accumulation of formaldehyde in the brain, which can damage your central nervous system and immune system and cause genetic trauma.

Sucralose/Splenda

Splenda is the trade name for a new synthetic compound called sucralose, comprised of two molecules of sucrose (sugar) and three molecules of chlorine. While some industry experts claim the molecule is similar to salt, other independent researchers say it has more in common with pesticides.

Observational evidence shows that there are side effects of Splenda, including skin rashes/flushing, panic-like agitation, dizziness and numbness, diarrhea, muscle aches, headaches, intestinal cramping, bladder issues, and stomach pain.

Stevia
...we recommend the herb stevia (Stevia rebaudiana) over sorbitol as a natural sweetener to our patients. Known in South America as the “sweet herb,” stevia has been used for over 400 years without ill effect.

Information like this makes me believe that the FDA and the companies that make these products are far more willing than I am to see my body used as a testbed for the latest chemical they've created.

Spring Sprung, Right on Time.

Despite the fact that snow was still melting on the north side of our house, the songbird's aubade greeted me as I awoke yesterday. That hasn't happened since last summer and so it appears to be a decisive herald of Spring. And, as it turns out, our calendar agreed with the bird on that day. Such synchronicity I find notable.

Monday, March 20, 2006


Using the latest version of Picasa, I retouched this photo of Arthur from almost exactly one year ago. Posted by Picasa

Saturday, March 11, 2006

Straw & Scratch-Coat


Straw & Scratch-Coat
Originally uploaded by King Cnut.

Here's a cool shot from about a year ago. The beginning of the first coat of stucco on our house.

Friday, March 10, 2006

Two Coyotes

I finally saw some coyotes, while they were sniffing about in the SE corner of our Cascara pasture.
They were very pretty, especially against the backdrop of snow. I'd love to see more of them, and perhaps get some photos, if they will hold still long enough.

Speaking of which, there will be no photos of our snow, because Heidi's camera lenses are out on loan to a photography student. It may be time to get that humdinger of a lense I've always wanted. You know, a lense that needs it's own tripod! Yeah!!!

Thursday, March 09, 2006

Snow. March 9th?!

The best snow we've had all year. March 9th.
Did any of you see the movie The Day After Tomorrow?
Wasn't that the campiest hokum you've seen since Parent Trap?
Nonetheless, measureable snow on March 9th hearkens thoughts of tropospheric ice-vortices, or whatever they were in that movie.
We're enjoying it though. It is pretty. I saw a tree that looked like Don Quixote, with helmet, breast and shoulder-plates of snow. Frosty beard. Resolute.

Tuesday, March 07, 2006

Heidi's Birthday

Heidi's birthday is on the 9th (two days hence).
I'm going to do one or more of the following:
  • Take her out to dinner
  • Take her out to dinner and invite family
  • Take her out to dinner and invite family and friends
  • Take her out on the town
  • Make her dinner
  • Make her lunch
  • Make her breakfast

Other ideas are welcome.

Oh, and in case you feel like harrassing her about aging, feel free to leave comments her and I'll see that she reads them. :D

Bingo!

We held a Bingo night at the Fargher Lake Grange last Saturday from 4-8. I was Chairman of the food committee, which should cause anxiety in the breast of all who know me. However, despite that fact, it was an overwhelming success.
The next Bingo Night will be April 1st, and there will be prizes, in addition to the cash-pot.