473,498 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pick list values into a table

RC
Can anybody help on this question?
When I select 3 values from the drop down list box, how can I insert into a
table?
Please help
Jul 20 '05 #1
3 4802
You can iterate over the selected items and execute an insert statement for
each.

--
Hope this helps.

Dan Guzman
SQL Server MVP

"RC" <re**********@hotmail.com> wrote in message
news:eXjqc.167874$f_5.94905@lakeread01...
Can anybody help on this question?
When I select 3 values from the drop down list box, how can I insert into a table?
Please help

Jul 20 '05 #2
Let's say, the column name of the drop down box is "depttype" and it has
three values because it is allowed to choose more than one value. should
I put three values into one column?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
> should I put three values into one column?

You probably don't want to do this because then your data would violate
first normal form and make the table a PITA to query. An appropriate
database design technique would be to store the values in a separate table
with a one-to-many relationship.

The example schema below allows a department to have multiple department
types. The application would insert a Department row and then one row into
Departments_DepartmentTypes for each selected DeparmentType.

CREATE TABLE DepartmentTypes
(
depttype varchar(10) NOT NULL
CONSTRAINT PK_DepartmentTypes PRIMARY KEY
)

CREATE TABLE Departments
(
deptcode varchar(10) NOT NULL
CONSTRAINT PK_Departments PRIMARY KEY
)

CREATE TABLE Departments_DepartmentTypes
(
deptcode varchar(10) NOT NULL,
depttype varchar(10) NOT NULL,
CONSTRAINT PK_Departments_DepartmentTypes
PRIMARY KEY(deptcode, depttype)
)
--
Hope this helps.

Dan Guzman
SQL Server MVP

"reneeccc west" <re**********@hotmail.com> wrote in message
news:40*********************@news.frii.net...
Let's say, the column name of the drop down box is "depttype" and it has
three values because it is allowed to choose more than one value. should
I put three values into one column?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #4

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

Similar topics

1
2136
by: Camiel | last post by:
Hi, I'm trying to do the following: create a form, with at the top a list of values drop-down box, filled with values from table A. Also at the top, an input box to enter a year. Below...
5
1964
by: Marie | last post by:
Access97 I have a table containing addresses with a separate field for State. Is there a way to create a query that returns an unique list of the states in that table and still be updateable? I...
10
4934
by: Mark Winter | last post by:
Hello, I am wondering if someone could point me in the right direction to figure out how to create a dynamic form. I have been developing programs in perl and oracle and have recently switched...
1
1978
by: Arun | last post by:
Hi Group, I was trying to link a combo box with a list control and having some trouble with that. Could anyone please help me with that. Here's the example of the scenario. Combo Box ;-...
4
64522
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
9935
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
4
6483
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
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
7165
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
7203
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...
0
7379
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
4908
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
4588
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
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
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.