473,499 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drop Down list in visual basic

Jon
I am trying to create a "front end program" to an oracle database and am
using visual basic .net to create the program that will accomplish this.
What i need to do and what i can't find is the code to create a drop down
list with 4 values and one (null) set as a default. I am sorry if i just
can't find the correct article here, i really did try to search for it, so if
anyone could help me i would appreciate it.
Nov 22 '05 #1
2 5643
Hi Jon,

It sounds like you want to use the combo box control. This control is found
on your tool bar. Put the control on your form and then under properties for
the property name, give it a proper name such as: cmbItems. Next the text
property for the combo box will have to be cleared it currently is populated
with : ComboBox1, just back space over this and save it.

Double click the Form and not the control and it should take you into the
form load event. It is usual standard practice to put values into the combo
box during form load so put your code within this area. Since you are only
talking about 4 items you could populate your combo box by using only code
such as:

cmbItems.Items.Add("Value 1")
cmbItems.Items.Add("Value 2")
cmbItems.Items.Add("Value 3")

Since the combobox's default is a null you do not have to worry about
setting it. Remember that what ever is set in the text is what goes to the
database.

What ever is in the cmbItem.text can be sent to the Oracle database or you
can attach it directly using the data source and data member with the Oracle
data adapter.

Hopefully this will solve your problem. Please read more about the combo box
in the help.
"Jon" wrote:
I am trying to create a "front end program" to an oracle database and am
using visual basic .net to create the program that will accomplish this.
What i need to do and what i can't find is the code to create a drop down
list with 4 values and one (null) set as a default. I am sorry if i just
can't find the correct article here, i really did try to search for it, so if
anyone could help me i would appreciate it.

Nov 22 '05 #2
Hi Jon,

It sounds like you want to use the combo box control. This control is found
on your tool bar. Put the control on your form and then under properties for
the property name, give it a proper name such as: cmbItems. Next the text
property for the combo box will have to be cleared it currently is populated
with : ComboBox1, just back space over this and save it.

Double click the Form and not the control and it should take you into the
form load event. It is usual standard practice to put values into the combo
box during form load so put your code within this area. Since you are only
talking about 4 items you could populate your combo box by using only code
such as:

cmbItems.Items.Add("Value 1")
cmbItems.Items.Add("Value 2")
cmbItems.Items.Add("Value 3")

Since the combobox's default is a null you do not have to worry about
setting it. Remember that what ever is set in the text is what goes to the
database.

What ever is in the cmbItem.text can be sent to the Oracle database or you
can attach it directly using the data source and data member with the Oracle
data adapter.

Hopefully this will solve your problem. Please read more about the combo box
in the help.
"Jon" wrote:
I am trying to create a "front end program" to an oracle database and am
using visual basic .net to create the program that will accomplish this.
What i need to do and what i can't find is the code to create a drop down
list with 4 values and one (null) set as a default. I am sorry if i just
can't find the correct article here, i really did try to search for it, so if
anyone could help me i would appreciate it.

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10743
by: bonehead | last post by:
This is really a html question but I'm posting it here because it's related to a php site I'm developing. I'd like to have a drop-down box (or 'combo box' as it's called in visual basic) that...
1
1420
by: Jon | last post by:
I am trying to create a "front end program" to an oracle database and am using visual basic .net to create the program that will accomplish this. What i need to do and what i can't find is the code...
3
26254
by: Stephen Adam | last post by:
Hi there, I'm sure i'm missing something really simple here, all i want to do is get the value of the selected item in a list box. Even after much fiddling about last night I still could not get...
2
2383
by: Eric Dan | last post by:
Hi, Even tough I was able to implement what I want in a weird and non efficient way, I would like to get an opinion what is the right way to achieve my task: Scenario: • Display a DataGrid...
5
4202
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
2
3008
by: Dave A | last post by:
I am stuggling with databinding a drop down list, hooking into the SelectedIndexChanged and attempting to avoid using the viewstate. The drop down list is quite large so I would prefer to avoid...
0
1500
by: thebison | last post by:
Hi all, I hope someone can help with this relatively simple problem. I am building a timesheet application using ASP.NET C# with Visual Studio 2003.As it is only a protoype application, my...
2
1254
by: Faez | last post by:
How can i add an index name (text) of a Drop-Down List to a TextBox at run time, using Visual Basic language, in Visual Studio 2005? for example: drop down list for student's age are as...
3
14979
by: Brad Isaacs | last post by:
ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind On my .aspx page I have added an SQL Datasource that contains the SQL query to retrieve the list for my Drop Down List Box. Using...
2
1900
by: shaznay2 | last post by:
I need some help! I'm trying to set up two drop down menus where the first displays the Department and the second displays the names of the printers found in the department. So far i have two...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.