Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
GeneralRe: Save and Retrieve Image Pin
nirmalgopalakrishnan29-Dec-12 6:07
nirmalgopalakrishnan29-Dec-12 6:07 
GeneralRe: Save and Retrieve Image Pin
Richard MacCutchan29-Dec-12 6:17
mveRichard MacCutchan29-Dec-12 6:17 
AnswerRe: Save and Retrieve Image Pin
nirmalgopalakrishnan29-Dec-12 19:14
nirmalgopalakrishnan29-Dec-12 19:14 
GeneralRe: Save and Retrieve Image Pin
Richard MacCutchan29-Dec-12 21:22
mveRichard MacCutchan29-Dec-12 21:22 
GeneralRe: Save and Retrieve Image Pin
nirmalgopalakrishnan30-Dec-12 19:57
nirmalgopalakrishnan30-Dec-12 19:57 
GeneralRe: Save and Retrieve Image Pin
Richard MacCutchan30-Dec-12 22:19
mveRichard MacCutchan30-Dec-12 22:19 
GeneralRe: Save and Retrieve Image Pin
nirmalgopalakrishnan31-Dec-12 17:28
nirmalgopalakrishnan31-Dec-12 17:28 
GeneralRe: Save and Retrieve Image Pin
Richard MacCutchan31-Dec-12 22:50
mveRichard MacCutchan31-Dec-12 22:50 
nirmalgopalakrishnan wrote:
I am unable to determine what is the problem here
From a previous post you have the following code:
C#
byte[] bytesofphotosretrive;
bytesofphotosretrive = (byte[])r["photo"];
MemoryStream mst = new MemoryStream(bytesofphotosretrive);
{
    frm1.pictureBox5.Image = Image.FromStream(mst);
}

So you need to find out why mst is null at this point. Your code is assuming that you always get a valid byte array from r (whatever that is), and hence a valid stream. However, if either of these commands do not return the expected result you are going to have a problem which you are not catering for. You should never assume that method calls like this will always succeed; add some error checks so you can diagnose it properly when it fails.
One of these days I'm going to think of a really clever signature.

AnswerRe: Save and Retrieve Image Pin
Abhinav S28-Dec-12 23:38
Abhinav S28-Dec-12 23:38 
GeneralRe: Save and Retrieve Image Pin
nirmalgopalakrishnan29-Dec-12 5:16
nirmalgopalakrishnan29-Dec-12 5:16 
QuestionDynamic text box array and focus event Pin
Everetts28-Dec-12 8:41
Everetts28-Dec-12 8:41 
AnswerRe: Dynamic text box array and focus event Pin
Eddy Vluggen28-Dec-12 10:25
professionalEddy Vluggen28-Dec-12 10:25 
GeneralRe: Dynamic text box array and focus event Pin
bambuz28-Dec-12 14:33
bambuz28-Dec-12 14:33 
GeneralRe: Dynamic text box array and focus event Pin
Everetts28-Dec-12 16:41
Everetts28-Dec-12 16:41 
QuestionConnection String in Properties.Settings Pin
TheJudeDude28-Dec-12 7:47
TheJudeDude28-Dec-12 7:47 
AnswerRe: Connection String in Properties.Settings Pin
SledgeHammer0128-Dec-12 8:27
SledgeHammer0128-Dec-12 8:27 
AnswerRe: Connection String in Properties.Settings Pin
Eddy Vluggen28-Dec-12 8:30
professionalEddy Vluggen28-Dec-12 8:30 
GeneralRe: Connection String in Properties.Settings Pin
TheJudeDude28-Dec-12 8:49
TheJudeDude28-Dec-12 8:49 
GeneralRe: Connection String in Properties.Settings Pin
Eddy Vluggen28-Dec-12 9:01
professionalEddy Vluggen28-Dec-12 9:01 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult28-Dec-12 14:04
mvePIEBALDconsult28-Dec-12 14:04 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 7:18
SledgeHammer0129-Dec-12 7:18 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult29-Dec-12 7:23
mvePIEBALDconsult29-Dec-12 7:23 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 7:29
SledgeHammer0129-Dec-12 7:29 
GeneralRe: Connection String in Properties.Settings Pin
PIEBALDconsult29-Dec-12 7:43
mvePIEBALDconsult29-Dec-12 7:43 
GeneralRe: Connection String in Properties.Settings Pin
SledgeHammer0129-Dec-12 7:47
SledgeHammer0129-Dec-12 7:47 

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.