CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

August 2004 - Posts

  • Get rid of your local SQL server : create a virtual one

    I had lost my entire configuration trying to upgrade to sp2. The upside is that I could install things differently. My main objective was to get rid of the local SQL server. Which succeed following these steps:

    • Create a new machine in virtual PC
    • OS type server 2003
    • Install Small bussiness server from MSDN disk.

    This resulted in a nice virtual server 2003. It works in 256 mb of RAM and will run side by side with Visual Studio on a 512mb laptop. But SBS does not include SQL server and the default SQL server wil not install.

    • Download the SBS premium disk from MSDN. This disk is not in the MSDN shipment. (?)
    • Install the premium disk after reading the setup instructions. There are some things to watch, the instructions are clear.

    And now I have a virtual SQL server. The nice thing about a virtual server is that it can run on different hardware. When I need a fast mult-connection setup I can run it on my gameboy (fast P4 with loads of RAM) When I need portability I can run it on my notebook, side by side with VS. And when I want a quit office I can run it on my tablet. Virtual PC side by side with Outlook and Feeddemon. Quite flexible.

    I had also hoped to get rid of localhost and use IIS 6 on server 2003 instead. This led to some problems

    • You have to be logged on to the domain to have suffiecient rights. In the VS side by side scenario this leads to a chicken-egg problem. I have to logon to start virtual PC and virtual PC has to be running to log on. Perhaps via switching user in XP ?
    • Setting up debugging is quite a job. Beside setting user rights you have to fiddle with the firewalls to set up DCOM.

    For the moment I'll stick to localhost. Havn't decided what to do yet. Finish the fiddling or upgrade XP itself to server 2003 ?

    But I am rid of my local SQl and that really makes a difference.

    Peter

  • XP sp2 blue(screen)s

    I have taken installing SP2 to lightly. Installation on the tablet went OK. The new input panel is great and I did not experience any real trouble at all working with SP2. Upgrading our gameboy (multi media machine) to SP2 went well as well. It knocked out nero image drive, but the Daemon-tools virtual CD/DVD still works well. There is an issue with that when installing SP2, my neighbour's tip solved that.

    The blues, even worse it was mood indigo, came with the upgrade of my development machine. I had a backup of all essential files and jumped in. This is what happened

    • Started the setup
    • Setup failed and rolled back the installation
    • Machine rebooted
    • Windows starts and the explorer crashes leaving me with a machine without an UI

    I hadn't read this yet and tried fixing it the usual way with windows setup. On MSDN there is a setup which includes sp1. Usally running repair from setup fixes everything. Without any loss of settings. This time I had no luck at all. The setup went well but when rebooting the screen turned blue. Several attempts with the recovery console were unfruitfull. As a last resort I tried a repair with a XP first edition setup. Same result, machine is gone. Installed a fresh copy of Windows. All my files were still there, no need to go for the backup. The first thing I installed was sp2. Without a glitch.

    The setup faillure may have been my own “fault”. On the machine was a SQL(sp3) installation and I'm not sure if I shut it down before starting the upgrade. The combination of SQL server and SP2 is often mentioned as troublesome. But not in the setup part. Which is exactly where I slipped. Running SP2 is not the problem, the setup is flaky. The MS knowledge base article is reported here not to solve this.

    Installing a fresh instance of Windows never harms. In nearly 2 years the machine had collected an enormous amount of software, this is a chance to see what I really need. This time I'm going for a different approch. Instead of installing SQL and IIS I'm going to run a virtual server. Virtual PC running small bussiness server 2003. My development machine will be far cleaner and the webserver is now portable. Also on the machine were Delphi 5 and 6 installments with loads of add-ons. Getting all that right will be the worst part of the trip. Two more virtual machines coming up.

    Peter

  • Two (1/2) remote desktop tips

    I'm still very happy with my tablet PC. It has become my mail /bloging machine, and I take it with me all the time. To use it on my desktop I use a remote desktop connection. Works nice, the default orientation of the tablet is portrait but logging in remote it defaults to landscape.

    • Set the remote desktop size to fit your desktop, not that of the remote machine

    You can have a remote desktop which is larger than the real desktop. The tablet has a resolution of 768*1024. The primary monitor of my desktop as well, but it's seconday is 1280*1024. Setting the remote desktop size (the display tab in the RDP settings) to 1280*1024 will produce a larger desktop for the remote machine. But when scrolling a window the new info can be garbled making the larger desktop unusable. In my case the display driver of the client was to blame, I did find a solution which also works with the faulty driver:

    • In case of a garbled display : When firing up a larger remote dektop make sure the display from which you fire up the desktop is at least the size of the remote one.

    A remote desktop allways fires up on the primary display, in my case this is 1024*768. Setting this temporarely to 1280*1024 (the size of my second display) leads to a perfect big RDP.

    Another tip I learned from someone else.

    • Nest remote desktops, start one from another remote desktop

    The scenario he used it for is security. Many machine are only accesible from one specific address. Using a RDP. When he's on the road he logs into the trusted machine with an RDP and starts new RDP's from there to administer the machines. Works like charm, although it can be quite confusing. WhereAmI ?

    Peter

  • Typed datasets, datasources and multiple tables in Whidbey

    My way of working with data in .NET 1.x is using typed datasets. I have a library which creates typed dataset objects and fills them using one (ore more !) sqladapaters. On the web form I have a dataset component to which the web controls are bound. It takes some plumbing to get the data in and out of the database to the dataset on the form but it works very well. New to Whidbey are the datasources which will do all the plumbing for you. All very quick, but most of them are somewhat dirty. You drop a database table from the server explorer on the web-form and get a fully editable browser grid without writing a line of code. To enable the edit you have to set the GridView's AutogenerateXXbutton properties to true. Nice, but the problem with that is that the code on the form directly connects to the database. No multi-tier and it will not scale very well.

    A neater way is to create datacomponents for your database interaction. The objectdatasource will do the plumbing to connect a gridview (or other data-aware component) to the data-component. The datacomponent is a somewhat strange creature. It is an xsd file and wraps up the schema for the dataset. VS will generate the typed dataset class. A datacomponent also wraps up tableadapters. These are best compared to the sqldata-adapters in 1.x. For every query result set (having the same columns) in the datacomponent the wizard generates a tableadapter class. So if you have two tables in the datacomponent, say invoices and invoicelines the wizard will generate three classes (containing loads of helper classes), one for the dataset, one for the tableadapter to retrevie an invoice-row and one for the tableadpater to retrieve the invoice-lines. A new query selecting a single invoice is part of the same tableadapater as the query returning all invoices.

    The catch is that most datasources, including the objectdatasource, work with one table of data. The objectdatasource binds to the tableadapaters, not the dataset. So to work with a multi-table dataset you need multiple datasources. There were two datasource components in 2005 which can work with a multiple table dataset. First comes the DataSetDataSource, it has a method to get the datset wrapped up, it doesn't have a method to set it. You have to fill it from an XML file or string. The component will be dropped in the next VS 2005 beta; most functionality is also in the XMLdatasource component. That component has no dataset aware properties at all, again you have to fill it from file or string. To get database data in and out requires writing your own plumbing again. As every dataset is an XML document and every well formed XML document can be treated as a dataset that is a do-able job. But it is a far cry from the ease of the other datasources.

    Typed datasets are quite nice at design time. You layout the columns of the grid and the like right from the datsets's definition. In 2003 it is from the dataset's definition, in 2005 it is from the tabeladapters defintion. A nice target for a multitable dataset is a treeview. It accepts an xmldatasource in the properties you can assign the schema of the xml-documents. Alas the designer will not get a clue of the contents of the schema, you have to edit the databindings of the tree-nodes all by hand.

    A lot has changed in 2005. It is good to see how most of the boring plumbing code is generated. But I'm not that happy how the dataset itself has moved out of  focus in favor of the tableadapater. I do use a multi-table dataset and writing plumbing for them hasn' t become easier at all.

    Peter

     

     

    .

  • Do look back

    Wintellect has a nice poll on their site: What is the oldest significant piece of code you have in a current application The only thing which surprises me in the results is the number of “less than 6 months” votes. The heroes who dumped everything and took a fresh .net start ?

    Peter

  • ICT and health care

    An official report on the use of ICT in Dutch health care has warned for risks. It lists the usual suspects like loss of data, medical data being unavailable due to the system being down, identity theft, malfunction, human errors, and so on.

    The report is important because in 2006 all Dutch medical files are planned to be digital. The main cause of problems mentioned were small local systems, far too much info is only in the PC of the doctor's assistant. Out of reach of the central IT department's backup regime, not able to communicate with the centralized info systems.

    There's still a lot to be done.

    Peter

  • Tablet PC and .NET

    Ever since seeing the first glimpses of one I was hooked : a tablet PC. Last Dotned meeting seeing Sander working with one I decided it was time to find me one.

    Browsing around I picked an Acer travelmate C110. Actually buying one was a little harder. Tablet's are still not popular yet, using Google I found it available at a cheap Web-shop, listed as a notebook. The reviews for the shop were ok, the price good (under 1500€ excl. Vat) so l took the gamble.

    It is a fantastic machine. With a Centirino running at I GHz and 512 Mb  as powerful as a "real" note book and it breathes connectivity through all it's connectors;

    • USB 2.0
    • Firewire
    • WiFi(g)
    • bluetooth
    • Infra-red

    All of this packed in 1.5 kilos.

    A tablet makes a perfect target for XP sp2. Which will. upgrade the OS to tablet 2005, which is like XP pro with a very good handwriting input. (Only when you write in English) and heads to funny Spel lies errors. Am using it right now and deliberately did not correct it's last opinion on what I had chalked.

    Where does NET fit in.? the tablet's specific api's are NET assemblies, (Actually they wrap up Com) The framework is part of the default install. Who's next?

    Peter

     

     

  • What's new on MSDN

    The MSDN site has a blog which lists and describes all new articles published. Subscribed.

    Peter

  • What's hot

    Hot. Or is cool the word?

    What was reasonably hot was my holiday. Tried to do some work, but that ended up in doing no not as much all  I had hoped to do. lt wasn't the lack of internet and the like, it was the laid back atmosphere. Thank goodness, I'm still a human being. The main thing my notebook had to do was collect the images of my camera. But in the background I was still on the .NET.

    Coming home we had a heat wave. Had to make my deadline and spent some days sweating. But the holiday had worked, managed to write a big chapter on ADO.NET. We're still on schedule.

    Very hot is is the VS 2005 beta. After upgrading SQL to the latest service pack I could find, it is as stable as a rock. Didn't see that many blog-posts and ng-activity around it as I had expected.

    Hot is every meaning of the word is my new tablet PC. Burns a hole in your arm but it is so cool.

    Well that's a lot of things to blog about for the coming time. I will follow up.

    Happy .net-ting, Peter

     

     

     

More Posts