How to store multiple mailing addresses

J

Jay Villa

I want to store multiple mailaddress like home address and shipping address
Sometimes addresses will be more than two. I am thinking about storing the
details as a dictionary object. Any other suggestions.

Thanks
Jay
 
R

Ray Costanzo [MVP]

Storing them where? Typically, data is stored in a database, but if you're
talking about dictionary objects, can you put this in context?

Ray at work
 
J

Jay Villa

When I said storing it means, I have asp pages where users will be enter
multiple address on the screen, I have to gather the data(addresses) from
the asp page and finally i should update the database. Hope I am making
sense ....

Any suggestions. Hope I am making clear .....
 
C

Curt_C [MVP]

Jay said:
When I said storing it means, I have asp pages where users will be enter
multiple address on the screen, I have to gather the data(addresses) from
the asp page and finally i should update the database. Hope I am making
sense ....

Any suggestions. Hope I am making clear .....

So just create the blanks and gather the info like normal. I guess I'm
failing to see where the difficulty is, specific to gathering multiple
addresses?
 
A

Aaron Bertrand [SQL Server MVP]

the asp page and finally i should update the database.

Ah, you're using a database! Eureka! Now, what kind? Access, SQL Server,
MySQL, Oracle, dBase, FoxPro, Excel, ...?

Depending on what other information you are storing, the typical design is
something like this:

CREATE TABLE dbo.Customers
(
CustomerID INT PRIMARY KEY,
FirstName VARCHAR(32),
LastName VARCHAR(32),
...
)

CREATE TABLE dbo.CustomerAddresses
(
CustomerID INT NOT NULL FOREIGN KEY
REFERENCES dbo.Customers(CustomerID),
Address1 VARCHAR(64),
Address2 VARCHAR(64),
City VARCHAR(32),
-- State, Zip, Country, Phone
-- implementation depends on location,
-- customer base and requirements
Type TINYINT -- e.g. Home, Work, Primary, etc.
)

I've left other things out, such as indexes and constraints. But basically
this allows you to have customer data stored once, and 0, 1, or multiple
addresses stored for each customer.

A
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,838
Members
47,385
Latest member
Joneswilliam01

Latest Threads

Top