Click here to Skip to main content
15,896,557 members
Home / Discussions / C#
   

C#

 
QuestionBest way to do this? Pin
SledgeHammer0111-Dec-12 4:55
SledgeHammer0111-Dec-12 4:55 
AnswerRe: Best way to do this? Pin
Gerry Schmitz11-Dec-12 12:28
mveGerry Schmitz11-Dec-12 12:28 
GeneralRe: Best way to do this? Pin
SledgeHammer0111-Dec-12 13:21
SledgeHammer0111-Dec-12 13:21 
GeneralRe: Best way to do this? Pin
Gerry Schmitz11-Dec-12 14:05
mveGerry Schmitz11-Dec-12 14:05 
GeneralRe: Best way to do this? Pin
SledgeHammer0111-Dec-12 14:25
SledgeHammer0111-Dec-12 14:25 
Questiondevelop code project functionality(view forums/questions) in codeproject like steps View Pin
Firoz(Pappu)11-Dec-12 3:40
Firoz(Pappu)11-Dec-12 3:40 
AnswerRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Richard MacCutchan11-Dec-12 5:00
mveRichard MacCutchan11-Dec-12 5:00 
GeneralRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Firoz(Pappu)11-Dec-12 5:37
Firoz(Pappu)11-Dec-12 5:37 
GeneralRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Pete O'Hanlon11-Dec-12 6:01
mvePete O'Hanlon11-Dec-12 6:01 
GeneralRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Firoz(Pappu)11-Dec-12 20:30
Firoz(Pappu)11-Dec-12 20:30 
GeneralRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Pete O'Hanlon11-Dec-12 20:37
mvePete O'Hanlon11-Dec-12 20:37 
AnswerRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Jay Nardev12-Dec-12 21:43
Jay Nardev12-Dec-12 21:43 
GeneralRe: develop code project functionality(view forums/questions) in codeproject like steps View Pin
Firoz(Pappu)12-Dec-12 22:17
Firoz(Pappu)12-Dec-12 22:17 
QuestionC# javascript communication Pin
tashee11-Dec-12 2:12
tashee11-Dec-12 2:12 
AnswerRe: C# javascript communication Pin
V.11-Dec-12 3:40
professionalV.11-Dec-12 3:40 
QuestionWCF Services in a multi threaded application results in Oracle Connection request Timed out error Pin
rajaron11-Dec-12 0:16
rajaron11-Dec-12 0:16 
Questionimage from access database in c# Pin
kojoam110-Dec-12 4:10
kojoam110-Dec-12 4:10 
QuestionRe: image from access database in c# Pin
Richard MacCutchan10-Dec-12 21:29
mveRichard MacCutchan10-Dec-12 21:29 
AnswerRe: image from access database in c# Pin
Pete O'Hanlon10-Dec-12 22:15
mvePete O'Hanlon10-Dec-12 22:15 
GeneralRe: image from access database in c# Pin
Richard MacCutchan10-Dec-12 22:40
mveRichard MacCutchan10-Dec-12 22:40 
AnswerRe: image from access database in c# Pin
Pete O'Hanlon11-Dec-12 0:08
mvePete O'Hanlon11-Dec-12 0:08 
Richard's right. Add a breakpoint on the if statement. To do this, you can click on the line and press F9 (this is the shortcut to toggle the breakpoint on and off). You should see a red dot appear in the gutter in Visual Studio. Press F5 to run your application. When you hit the if statement, press F10 to step over the code. If you do this you will find out if this value is null or not.

Now, one thing I would do is wrap the MemoryStream in a using statement. A MemoryStream is a disposable object, so you should always dispose of it. This would give you:
C#
using (MemoryStream ms = new MemoryStream(photo_array))
{
  picBox1.Image = Image.FromStream(ms);
}
Your code will now dispose of the stream.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

Questionsave bitmap in C# Pin
gibsray10-Dec-12 0:55
gibsray10-Dec-12 0:55 
AnswerRe: save bitmap in C# Pin
Pete O'Hanlon10-Dec-12 1:14
mvePete O'Hanlon10-Dec-12 1:14 
AnswerRe: save bitmap in C# Pin
OriginalGriff10-Dec-12 1:26
mveOriginalGriff10-Dec-12 1:26 
QuestionC# Pin
Half Blood Prince9-Dec-12 22:32
Half Blood Prince9-Dec-12 22:32 

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.