views:

21

answers:

1

im trying to create a generic gallery application that uses a database, with the abilitiy to upload images from the website, using microsoft's visual web developer. -- im fairly new with databases and asp.net but am getting the hang of it i think ><

most of the examples i see are one mdf file with several tables. but i want something that i can use repeatedly as a generic template for my databases, as i have several galleries i want to create for my portfolio, or allow others to use it with little difficulty.

What im trying to avoid is having to go through each gallery and create new table adapters and or get/set methods for each new gallery

Should i use a separate mdf file with one table for each gallery? would this allow me to copy/paste each time i want to create a new database and by extension new gallery

thanks for your time

A: 

No need to use separate mdf files. You could have only one mdf file (database file).

Why don't you create a gallery table and an image table and connect both with a relationship?

1 Gallery -> has many -> Images - (M X N) relationship

1 image -> belongs to -> 1 Gallery

You could use Microsoft Entity Framework to avoid having to create new table adapters, get/set methods, etc, as it will create everything automatically to you.

Leniel Macaferi
eh, if im running this via jquery, having a bunch of different gallerys in one table wouldnt it be really hard to call a list of one table? i feel like there wouldnt be any good way to keep them grouped for setting up a gallery
Gazow
Not really. Using jQuery you can have a kind of lazy loading, that is, loading images in the background while the user visits the gallery. There is more than one way to implement this, but you should search how to do this using jquery.
Leniel Macaferi