desperate questions from a desperate ASP.NET 2.0 newbie

Discussion in 'Databases' started by aj31, Oct 12, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi all,

    I'm new to this whole ASP.NET 2.0 thing so please bear with me. I've developed a real estate website using Visual Web Developer 2005 Express Edition. It's a powerful tool. I've also created a database using SQL Server 2005 Express Edition. The website contains static as well as dynamic pages. The dynamic pages are really for the listings. I will have a listings.aspx page which will show property listings. Each row (listing) will have a "details" or "photos" link, which the user can click on.Upon clicking, the user is taken to that particular listing's details page, which will contain details (i.e. address, # of bedrooms, bathrooms, etc) AS WELL AS photos. Here are my questions:

    1) My "details" table houses columns like # of bedrooms, bathrooms, SQFT, and photo. In this table, I selected "image" as thedata type for the "photo" column. When setting up the table, I cannot put any data in the "photo" column at all. What do I need to do to show the photo(s) for each listing?

    2) In addendum to question #1, I would like to be able to put up to 4 photos per listing. Would I have to create more "photos" columns like "photo2", "photo3", and "photo4" in addition to the "photo" column?

    3) I know DiscountASP.net does not support MS SQL 2005 Express BUT they do have the SQL 2005 Attach tool in the control panel to attach a SQL Express database to their SQL 2005 database. Has anyone used this already? If so, what was your experience with it? Was it easy to use?

    Thank you all in advance!

    AJ
     
  2. 1>The column takes binary data.So you need to read the image into an array of bytes and and insert it.You can do that directly like other simple data types.

    2>I think,its 1 column per image.I would rather store images on the web server and have the path saved in the database with each listing.Reading/writing images to the file system is comparatively faster and easier to manage (you can have one folder per listing and have all the images in there).

    3>You can surely use the MS SQL tool suite to attach or restore database files from your MS SQL 2005 Express to MS SQL 2005 database without any problem.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thank you so much Vikram for your response.I would appreciate itifyou please show detailed steps on how to read the image into an array of bytes and how toinsert it. If easier, could you provide a link to a tutorial on this?


    Also, please show steps on how to store images on the web server and have the path saved in the database with each listing. Again, if you know of a link that'l show me how to do this, please provide.


    In the meantime, I'll research this online as well. Thanks.


    AJ
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page