Dear Friends,
I need to do a ListBox program.
I have a table called Country.
Fields are country_code and country_name.
I need to use this dropdownbox in a form Customer. Where I need to select a Country from a list box and it will be saved into the Customer table along with other fields.
I need to insert only country_code into customer table and no need of country_name. But in the form, in drop down box (Listbox) I need to show the county_name.
So How I can do this program ?.
My current program is given below
AddListBox ("frmCustomer","ListBoxCountry", 200, 160, 100, 25)
Command.CommandText = "SELECT * FROM t01_country"
Reader.Value = Command.ExecuteReader
Do While Reader.ReadNextRow = True
ListBoxCountry.Add(Reader.GetValue(1))
Loop
Reader.Close
If I use GetValue(0) I will get country_code
If I use GetValue(1) I will get country_name
How I can both, ie
In client side, dropdownbox shows the country_name
but when I click on a Save button, I need the value of country_code.
I am new to Basic4ppc, I think you got the idea,
In HTML.
It is like
<select name='country'>
<option value='IND'>India</option>
<option value='ESP'>Spain</option>
<option value='JPN'>Japan</option>
</select>
I think You got the idea. Could you please give a help to me
rgds
Jotis:sign0085::sign0085:
I need to do a ListBox program.
I have a table called Country.
Fields are country_code and country_name.
I need to use this dropdownbox in a form Customer. Where I need to select a Country from a list box and it will be saved into the Customer table along with other fields.
I need to insert only country_code into customer table and no need of country_name. But in the form, in drop down box (Listbox) I need to show the county_name.
So How I can do this program ?.
My current program is given below
AddListBox ("frmCustomer","ListBoxCountry", 200, 160, 100, 25)
Command.CommandText = "SELECT * FROM t01_country"
Reader.Value = Command.ExecuteReader
Do While Reader.ReadNextRow = True
ListBoxCountry.Add(Reader.GetValue(1))
Loop
Reader.Close
If I use GetValue(0) I will get country_code
If I use GetValue(1) I will get country_name
How I can both, ie
In client side, dropdownbox shows the country_name
but when I click on a Save button, I need the value of country_code.
I am new to Basic4ppc, I think you got the idea,
In HTML.
It is like
<select name='country'>
<option value='IND'>India</option>
<option value='ESP'>Spain</option>
<option value='JPN'>Japan</option>
</select>
I think You got the idea. Could you please give a help to me
rgds
Jotis:sign0085::sign0085:
Last edited: