jimbob1872's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Members
Active Posts:
20 (0.02 per day)
Joined:
08-January 13
Profile Views:
781
Last Active:
User is offline Jul 07 2014 07:22 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Who Cares
Favorite Gaming Platform:
XBox
Your Car:
Ford
Dream Kudos:
0
Icon   jimbob1872 has not set their status

Posts I've Made

  1. In Topic: losing image when using asp popupwindow

    Posted 24 Jun 2014

    If anyone else has any ideas.

    it would be this section of the code from above that i'm dealing with

      if (!imgPopUpload.HasFile)  
    
              {  
                   SqlDataReader reader = com.ExecuteReader();  
                  if (reader.Read())  
                   {     
                       bytes = (byte[])reader["Image"];  
                        com.Parameters.AddWithValue("@Image", SqlDbType.VarBinary).Value = bytes;  
                       com.ExecuteNonQuery();  
                   }  
              }  
    
    


    As i'm not wanting to add a new file but read what is already there in the database.
  2. In Topic: losing image when using asp popupwindow

    Posted 23 Jun 2014

    View Postmodi123_1, on 23 June 2014 - 09:03 AM, said:

    As long as you know it's a bad idea.

    Quote

    How can I hold the Image and redisplay it when returning to the main page after closing the pop up.

    Session variables? Have you tried shoving all of this data in there?


    For some reason I have been told not to use sessions on this project either which is making this harder than it needs to be. I'm just using stored procedures to add to a table and then a sqldatareader to read from the tables and display in textboxes. With the image I used a handler to convert the binary data. This is why I am having issues as I don't want to use an Image object and convert it in the popup. I just want to read it in so it does not wipe it to a null when I exit the window.
  3. In Topic: losing image when using asp popupwindow

    Posted 23 Jun 2014

    View Postmodi123_1, on 23 June 2014 - 08:47 AM, said:

    Quote

    I am creating a website in which a user can upload an image to a sql database. It is converted to varbinary

    May I ask why? Storing images in a db is probably the lest best practice. Why not store them in a folder and and store their name/path in the database?


    I've been told to get practice with SQL databases on my internship and so I decided to make a website storing and retrieving data. The reason why is irrelevant as I understand that storing in a folder would have been the best option from the start, but playing with varbinary seemed like good coding practice. Is there any way around this situation?

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
3
Programming Languages:
JAVA
C
HTML
VISUALBASIC

Contact Information

E-mail:
Private

Friends

jimbob1872 hasn't added any friends yet.

Comments

jimbob1872 has no profile comments yet. Why not say hello?