Daily Archives: March 26, 2004

Using multiple dataviews of one datatable

I banged my head over a problem for a while a few months ago. I was using a lookup datatable for a dropdown and also trying to use it for a search (to get some more key info when the user selected an item for the drop down). But this was screwing up the display in the dropdown.

The problem makes so much sense. Even though I was using two separate dataviews from the datatable, changing the pointer (record position) in the dataview really changes the position in the datatable, thereby affecting any dataviews based on the table.

Since the table is only a lookup table, I was able to solve the problem by creating a dataview based on a copy – datatable.copy.dataview, and using THAT dataview for the 2nd function where I was doing the search.

I had the gratification of having two people who had also been struggling with this same problem ask me for help. One was using two separate views of a lookup table for two dropdownlists, the other was using two separate views of a lookup table for two datagrids.

I supposed if you need to edit, then you have deal with that copy, since it is not going to be updated automatically.

time for transactions

Transaction processing for databases is one of those things I have always been ashamed that I never used  – though in most of my small applications, I only do one insert/update at a time. Now with .NET they are really easy to implement so no more excuses. I’m busy right now sticking them in my webservice back end that has a variety of methods that do different multiple updates and inserts – so I really do need to have transactions. If I have to do 5 inserts and one of them craps out, I am going to be WAY better off in my client application if I can rollback the whole gaggle of records.

just realized it’s 64 degrees outside

I’ve been sitting here in my office all morning in my flannel lined jeans and fleece – as I have all winter long! Who knew it was almost 65 degrees outside?! Throw open those windows! Where’s my bike? (oh god – do I have to wear my bike pants in public after this looooong winter?) I want to garden.

COME SPRING, COME!