MySQL and null date values

Oct 23
2012

Today I have lost about two hours to work around a very strange MySQL Connector.NET behaviour.

This code

oMySQLDataReader:IsDbNull( nFieldPos )

gives an exception if the value is a date and has a null value. The exact error was

“unable to convert MySQL date/time value to System.datetime”

I have tried several things, but even

oMySqlDataReader:GetMySQLDateTime( nFieldPos)

fails.
Some messages suggested to add

“Allow Zero Datetime=true;”

to the connection string, but with this one I was unable to retrieve ANY date value.

Only adding

“Convert Zero Datetime=true;”

to the connection string solved the problem.

Positioning a form before Show()

Oct 02
2012

It was driving me crazy: I was not able to position a form before showing it. It was shown every time the height of my taskbar below the desired vertical position.

The solution was very simple: assign FormStartPosition.Manual to the :StartPosition member of the form:

self:StartPosition := FormStartPosition.Manual
self:Size := Size{ oDesktop:Width, oDesktop:Height }
self:Location := Point{ nX, nY }

Powerful Grid control for .NET applications

Oct 02
2012

After searching a while for a powerful and affordable grid control, I have found iGrid.NET from 10Tec, an Ukrainian software house.

iGrid.NET Home

Not only that this grid is ways faster than the DataGridView and the ListView from .NET framework itself, and priced at a very affordable level, but also the author has replied very fast to my questions – so also the support is very good.

ObjectListView – higly recommended

Sep 07
2012

Recently I had to fight with the slowness and missing possibilites of the .NET listview, at least compared to the ListView class I had in Visual Objects.

Then I have found ObjectListView – an opensource ListView class hosted on SourceForge:

http://objectlistview.sourceforge.net/cs/index.html

TopItem property of .NET ListView fails

Sep 04
2012

Today I have lost a lot of time because the .TopItem property of a ListView does not worked. After assigning a new item to this property, the TopItem most of the time remained unchanged.

The cause was a bug in the .NET framework: if the text value of the first column is empty, then setting the TopItem property fails.

Arrange pictures in Windows 8 Gallery

Aug 27
2012

How to arrange the pictures in the Windows 8 Picture Gallery?

There is no possibility to configure the sequence, but you can do it using an old trick from Windows 7: append the sequence in parentheses to the picture name:
Picture23(01).jpg
Picture37(02).jpg
PictureIDontKnow(03.jpg)

winbindd at 100% cpu after system crash

Aug 17
2012

After a power shortage, nobody could connect to the Samba shares of a Debian Linux server, and a look at “top” on the Linux server showed that the winbindd process used 100% cpu.

The solution was easy:

/etc/init.d/samba stop
/etc/init.d/winbind stop

a kill -9 <processnumber> to the running winbindd process.

Find and remove the gencache.tdb file (/var/lib/samba/gencache.tdb on my Debian server).

/etc/init.d/samba start
/etc/init.d/winbind start
/etc/init.d/samba stop
net rpc join -U administrator%<admin_password>
/etc/init.d/samba start

This fixed the problem.

Configuration: Domain master is a Windows SBS 2003, main file server a Debian Linux Lenny server using winbind as primary autentication mechanism.

 

 

Data Corruption with DBF files on Windows 2008 server

Aug 09
2011

Recently I had several cases of missing records on a customers network: sometimes added records were missing, indices were corrupted or records incomplete.

Since this occurred with an application that on all other customers worked very well for years without any problems, I have researched until I found this link:

http://www.alaska-software.com/fixes/smb2/overview.shtm

This MSI adds three entries at

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters

In my application I have added the following code:

This solved the problem.

Save your old XP machine to your new Windows7 machine

Aug 04
2011

Basically, if you would save your old Windows XP machine to your new Windows 7 machine, the best thing you can do is to virtualize your old machine.

There are three cost-free virtualization solutions available:

I have tried all three, and I’m preferring VirtualBox for this because it seems to be the solution with the smallest overhead. VMware has become very fat, and also Virtual PC seems a little bit slow.

For the conversion of a living machine, there are only two handy tools available:

  • Sysinternals Disk2VHD tool creates a VHD image from a living machine (but please pay attention: there is a 127 GB limit) and can prepare it for use in MS Virtual PC ( live.sysinternals.com )
  • VMware vCenter Converter Standalone from VMware creates a complete VMware virtual machine (VMDK file) ( www.vmware.com )

The easiest way is using of VMware Converter to create a virtual machine and use these in VMware Player or server.

The Microsoft way can be easy also, but when there is something that does not work you can spend several hours until the entire thing works (there are two limits: 127 GB max for the virtual disk, and as host you need a Windows 7 Professional or Ultimate, no Home).

The personally preferred solution is to use VMware Converter to create a VMDK file, and use this then in VirtualBox, and this will be described more detailled here:

  • before launching the conversion with VMware Converter, you need to apply the MergeIDE tool (you can find the link here )
  • convert the machine saving the files to a network or USB drive
  • copy the virtual machine to the host machine
  • create the new virtual machine using the copied virtual machine files
  • in the settings of the virtual machine, you need these settings:
    enable APIC

    Enable APIC in VirtualBox

    select PIIX4 als IDE controller

    Enable PIIX4 in VirtualBox

  • After this you can try to start your machine. Unfortunately, probably you will have to re-activate Windows because of the “hardware” change.
    It is not so easy because before activating Windows over the network, you will need to make the network to work.
    If you are lucky, you have 3 days to do this, but on a Fujitsu Siemens machine (with a BIOS locked XP license) the only way to logon was a prior activation over the phone: the network can be configured only after login, but without activation a login was impossible.
  • if your machine was member of a Windows domain, its will be the best to configure the network as passthrough, not as NAT, because otherwise the domain controller cannot be reached.

Links:

Howto convert from VMware to VirtualBox
VMware Download Center
Howto migrate a Windows machine to VirtualBox

 

 

Buffalo NAS: Change language from Japanese to English

Jul 27
2011

The Buffalo Technology TeraStation of a customer needed a firmware update – and after this the Web GUI was in Japanese language.

Unfortunately I could not find any solution because all I could find were targeting an older web interface (before 2010) totally different from the actual one.

Fortunately I had another LinkStation Mini in my network with the same Web GUI, so I could look where to find how to switch the language.

Please look at the screen shot below:

Language setting