hello,
i have a Products table, and i want to make an image data type to one of his rows (Picture1 for example), i want to know, what is best, to store the picture in the database or store only the direction to the picture?
if i store only the direction, i should take it from some output parameters of the Upload function of ASP and the add it to the Database? can i add it to a special folder for example MySite\UserName\ + file name?
and another thing: let's say i have Promotion - tinyint, to store the promotion value of this product..If i show products using DataList, i could order my products first after Promotion and then after date added? could i use a special CssClass(font weight or other background) for the products witch has the Promotion more than 10 for example?
how can i know the exact date time (yy/mm/dd/hh/mm) ? - it is taked from the Server date?
thank you
Have a look at
http://www.codeproject.com/aspnet/PicManager.asp|||Hi zuperboy90,
i have a Products table, and i want to make an image data type to one of his rows (Picture1 for example), i want to know, what is best, to store the picture in the database or store only the direction to the picture?
if i store only the direction, i should take it from some output parameters of the Upload function of ASP and the add it to the Database? can i add it to a special folder for example MySite\UserName\ + file name?
Well, it depends. If your image file size is very large on everage, I would suggest you using sql database to store the link and using a file server to store the actual image file. Actually it's not too dificult to impliment. Using asp.net update control to store the image file to a specific folder, and pass the path(with the file name) to your backend database.
If your image file is not a big one,then just create a new field named "image" with type "binary(SIZE)", and fill this field using a stream writer. This is a very conveninet way if you only want to store some icon/thumbnail pictures.
There are lots of sample articles on this, just type "picture gallery asp.net" into google and you will find millions of resources.
Hope my suggestion helps
|||for a wile i store in my database only the link to the pictures (they are very many, and hight resolution), and i think i'll use something like ImageUrl = <%# Eval("url") %>, i don't know exacly how it will be, i'll se if it is ok when implementing the code that alowes you to add pictures, and then chose the best way
thank you