April 2002
Intermediate to advanced
416 pages
11h 50m
English
The simplest way to load data into an application is to put the data right into a program’s source code. This method is extremely simple so it is easy to implement and debug. The program loads the data quickly and the data cannot get lost.
If a program needs a simple piece of data that will never change, compiling the data into the code is a perfectly acceptable technique. Example program CompiledIn1, shown in Figure 1.1, uses the following code to load its State ComboBox. The Form’s Load event handler declares and initializes the array states to hold the names of the 50 U.S. states, plus D.C. Then it calls the ComboBox’s Items.AddRange method to add the values to the ComboBox:
Read now
Unlock full access