DataSource in ListBox and ComboBox

In VB.NET, both ComboBox and ListBox controls allow the software developer to define the DataSource.

However, there might be some errors occur if the way to define the DataSource is not correct.

Sequence to define DataSource and columns name

You are recommended to define the DataSource by the following sequence.

.DisplayMember = mstrDisplayMember
.ValueMember = mstrValueMember
.DataSource = objDS.Tables(0)

Beside that, always make sure that the value for .DisplayMember and .ValueMember are pointing to the correct columns name.


What happen if the sequence is wrong and the ValueMember is pointing to incorrect column name?

Some software developers prefer to put ".DataSource = objDS.Tables(0)" at the first line. If the value of the .ValueMember is incorrect, then VB.NET will prompt you an error message.

Example:

.DataSource = objDS.Tables(0)
.DisplayMember = mstrDisplayMember
.ValueMember = "Incorrect Column Name"

Error message = "Cannot bind to the new value member. Parameter name: value"


What happen if the sequence is correct but DisplayMember and ValueMember are pointing to incorrect columns name?

VB.NET will not prompt you any error message but the result in the controls will be displayed as "System.Data.DataRowView".

Example:

.DisplayMember = mstrDisplayMember
.ValueMember = "Incorrect Column Name"
.DataSource = objDS.Tables(0)

Result = System.Data.DataRowView (if the result returned 3 records, then VB.NET will show you 3 "System.Data.DataRowView")

Visual Studio 2003 Setup faild

There might be a lot of reasons why Visual Studio 2003 setup failed on your machine.

So, the best practice to trace the error is always refer to the "Installation_Log.txt".

If you found something like the following error message:

RunMSI.exe exited with return value 1601.
Error code 1601 for this component means "The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.



Then, you must do the following to resolve this error:

a). Install the Windows Installer 3.1 or Windows Installer 4.5

b). Redo the Visual Studio 2003 setup

Microsoft Security Advisory: Vulnerability in Microsoft Video ActiveX control could allow remote code execution

The following products are required to apply the latest fix from Microsoft in order to patch the security issue for video activex control:
  • Microsoft Windows Server 2003 Service Pack 2, when used with:
    • Microsoft Windows Server 2003, Standard Edition (32-bit x86)
    • Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
    • Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
    • Microsoft Windows Server 2003, Web Edition
    • Microsoft Windows Server 2003, Datacenter x64 Edition
    • Microsoft Windows Server 2003, Enterprise x64 Edition
    • Microsoft Windows Server 2003, Standard x64 Edition
    • Microsoft Windows XP Professional x64 Edition
    • Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
    • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows XP Service Pack 2, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional
  • Microsoft Windows XP Service Pack 3, when used with:
    • Microsoft Windows XP Home Edition
    • Microsoft Windows XP Professional
How Do I Apply This Fix?

1. Go to http://support.microsoft.com/kb/972890

2. Click the "Enabled Workaround - Fix It" button. You will required to download a msi file.

3. After complete the download, just run the msi file to install the fix in your computer.

4. After that, restart your computer (even the fix does not asking for it).

How to dbImport in Informix?

1. dbimport <database_name> -d <dbspace_name> -l buffered

NOTE: l = small L

2. ontape -s -B <database_name>

3. Go to the folder <database_name>.exp

4. dbaccess <database_name> pp.sql

PLS-00123: Program Too Large when compile invalid objects in PL/ SQL ?

Go to PL/ SQL -> Tools -> Preferences -> Oracle Debugger:

a). Un-check the "Add debug information when compiling".

b). Click the "Apply" button.

c). Click the "OK" button.

d). Compile invalid objects now.

NOTE: In case you want to debug your package in PL/ SQL, you will need to check the "Add debug information when compiling" checkbox.

Set Define Off in Oracle

Oracle will ask you to enter the value if your UPDATE statement is written as below:

Update my_table Set my_field = 'You & I are good boy';

At the end, the value for my_field will not be updated even you have entered something.

To overcome this problem, you just need to add one more statement before the UPDATE statement:

Set Define Off;
Update my_table Set my_field = 'You & I are good boy';


NOTE: This topic also related to DELETE or INSERT INTO statement.