Click here to Skip to main content
15,912,977 members
Home / Discussions / C#
   

C#

 
Question[Solved]C# Database Image Manager Pin
rattlerrFx31-Dec-14 10:44
rattlerrFx31-Dec-14 10:44 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:13
professionalRichard Andrew x6431-Dec-14 11:13 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:25
rattlerrFx31-Dec-14 11:25 
That's the whole problem the code doesn't produce an error or warnings during Debug or compilation just at Run time the error message pops up in a Message Box. The program is suppose to read the folder and load the image into the Image Picture Box nor will it upload the image to the database. The image column just shows 0x0000000 that is because none of the images are being loaded into the Image column for the table.

It will put information into the other columns just not the image, I cannot figure out if it is a permissions issue. Now when i select a different ImageID from the dropdown box the error will repeat itself here is the code below.

C#
private void imageIDComboBox_SelectedIndexChanged(
           object sender, EventArgs e)
       {
           try
           {
               int imageID = Convert.ToInt32(imageIDComboBox.Text);

               // read image bytes from the database and display in picture box
               Byte[] imageByteArray = ProductDB.ReadImage(imageID);
               MemoryStream ms = new MemoryStream(imageByteArray);
               imagePictureBox.Image = System.Drawing.Image.FromStream(ms);
               ms.Close();
           }
           catch (Exception ex)
           {
               MessageBox.Show(this, ex.Message, "Error");
           }
       }


modified 31-Dec-14 17:34pm.

AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:27
professionalRichard Andrew x6431-Dec-14 11:27 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:36
rattlerrFx31-Dec-14 11:36 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 11:39
professionalRichard Andrew x6431-Dec-14 11:39 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 11:45
rattlerrFx31-Dec-14 11:45 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:00
professionalRichard Andrew x6431-Dec-14 12:00 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:08
rattlerrFx31-Dec-14 12:08 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:11
professionalRichard Andrew x6431-Dec-14 12:11 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:20
rattlerrFx31-Dec-14 12:20 
GeneralRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:24
professionalRichard Andrew x6431-Dec-14 12:24 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:24
rattlerrFx31-Dec-14 12:24 
AnswerRe: C# Database Image Manager Pin
Richard Andrew x6431-Dec-14 12:27
professionalRichard Andrew x6431-Dec-14 12:27 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:29
rattlerrFx31-Dec-14 12:29 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:42
rattlerrFx31-Dec-14 12:42 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 12:30
SledgeHammer0131-Dec-14 12:30 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:34
rattlerrFx31-Dec-14 12:34 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 12:45
SledgeHammer0131-Dec-14 12:45 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 12:55
rattlerrFx31-Dec-14 12:55 
GeneralRe: C# Database Image Manager Pin
SledgeHammer0131-Dec-14 14:21
SledgeHammer0131-Dec-14 14:21 
GeneralRe: C# Database Image Manager Pin
rattlerrFx31-Dec-14 19:22
rattlerrFx31-Dec-14 19:22 
GeneralRe: C# Database Image Manager Pin
SledgeHammer011-Jan-15 6:48
SledgeHammer011-Jan-15 6:48 
GeneralRe: C# Database Image Manager Pin
rattlerrFx1-Jan-15 7:17
rattlerrFx1-Jan-15 7:17 
Question(solved) an interesting "edge case" in use of Action as Value in generic Dictionary: C# language discussion Pin
BillWoodruff31-Dec-14 0:40
professionalBillWoodruff31-Dec-14 0:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.