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

Reputation: 1 Apprentice
Group:
Members
Active Posts:
20 (0.04 per day)
Joined:
08-January 13
Profile Views:
564
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?
  4. In Topic: Java Console as a GUI

    Posted 8 Apr 2013

    forgive me, by eclipse console i meant the output of the console view in Eclipse IDE and by external console i meant place that text into a separate Jframe gui
  5. In Topic: moving a token

    Posted 29 Mar 2013

    View PostMartyr2, on 29 March 2013 - 12:12 PM, said:

    I think it is because you have your token positioning inside the for loop. This means that when you pass "1" to displaytoken it is going to be adding 1 to tokenpositiony each time around the outer for loop. Meaning that essentially you are adding 1 to the token y position "i" number of times. So both the token position for x and for y should probably be outside the loop so that you do the loops, then you set tokenpositionx and tokenpositiony the correct number of positions and then set it on the board.

    Hope you get what I mean. :)/>


    I changed it to the way you described I think but when testing with the token set on 3,3 it just runs the method and then shows the board with the token on 0,1 as if its setting the co-ordinates back to 0,0 and adding 1?

    	public void displayToken(int a, int B)/>{
    
    
    		for(int i=0; i < (width-1); i++){
    			for(int j=0; j < (height-1); j++){
    				board[i][j].tokenPos(false);
    			}
    		}
    		tokenpositionx = tokenpositionx + a;
    		tokenpositiony = tokenpositiony + b;
    
    		board[tokenpositionx][tokenpositiony].tokenPos(true);
    
    	}
    
    	public void moveTokenUp(){
    
    		if((board[tokenpositionx][tokenpositiony].up == false)){
    		System.out.println("Cannot make that token move.");
    		
    		}
    		
    		else if((board[tokenpositionx][tokenpositiony].up == true && board[tokenpositionx][tokenpositiony+1].down == true) ){
    			displayToken(+0,+1);
    			
    			showBoard();
    		}
    	}
    

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?