Friday, March 31, 2006
Databinding Confusion
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
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
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
Here are my assertions:
- The artificial sweetener landscape is highly irrational.
- The most popular sweeteners are not safe.
- The safest sweeteners are not popular.
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
SteviaSplenda 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.
...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.
Monday, March 20, 2006
Saturday, March 18, 2006
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
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?!
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
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!
The next Bingo Night will be April 1st, and there will be prizes, in addition to the cash-pot.