Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to redirect the page when the particular cell in the datagridview is double clikced Pin
Henry Minute22-Aug-09 2:30
Henry Minute22-Aug-09 2:30 
AnswerRe: how to redirect the page when the particular cell in the datagridview is double clikced Pin
Saksida Bojan21-Aug-09 6:32
Saksida Bojan21-Aug-09 6:32 
Questionhow to call method of mdi child form from mdi parent form Pin
Tridip Bhattacharjee21-Aug-09 3:21
professionalTridip Bhattacharjee21-Aug-09 3:21 
AnswerRe: how to call method of mdi child form from mdi parent form Pin
0x3c021-Aug-09 3:27
0x3c021-Aug-09 3:27 
QuestionUnable to read Private Key as XML String Pin
Jadhav Ajay21-Aug-09 2:25
professionalJadhav Ajay21-Aug-09 2:25 
AnswerRe: Unable to read Private Key as XML String Pin
Keith Barrow21-Aug-09 3:04
professionalKeith Barrow21-Aug-09 3:04 
GeneralRe: Unable to read Private Key as XML String Pin
Jadhav Ajay22-Aug-09 0:37
professionalJadhav Ajay22-Aug-09 0:37 
QuestionObjectDisposedException within a while loop? Pin
Trapper-Hell21-Aug-09 1:56
Trapper-Hell21-Aug-09 1:56 
I have this method that accepts a ZipFile as a parameter and does some work etc, but after looping within a while loop, the parameter (ZipFile) is disposed... I will show a quick example instead of the original code because it would be unnecessarily complex.

private byte[] GetImage(ZipFile originalZipFile, string pass)
{
  while(true) // Here is a condition that loops for some time, according to a specified number
  {
    ZipFile zipFile = originalZipFile // <- Exception occurs here, after the 2nd loop (originalZipFile is somehow disposed)
    foreach(ZipEntry zEntry in zipFile)
    {
       if(true) // If the condition is met, the object is returned
         return new byte[];
    }
  }
}


I have attempted to keep the example simple enough.. So, zipFile is closed and set to null within the while loop, even before the return (else an exception occurs, since the ZipFile is using a FileStream which is later needed). However, originalZipFile is for some reason being disposed without any calling directly accessing it Mad | :mad: (that is why originalZipFile is copied into zipFile)

What can I do in order to keep originalZipFile from being disposed? Or what am I doing wrong? Thanks!

(As far as I am concerned, ZipFile is a class not a struct, so there shouldn't be any problems, with multiple references to the same 'object' on the stack).
AnswerRe: ObjectDisposedException within a while loop? Pin
Gideon Engelberth21-Aug-09 3:46
Gideon Engelberth21-Aug-09 3:46 
AnswerRe: ObjectDisposedException within a while loop? Pin
Luc Pattyn21-Aug-09 4:21
sitebuilderLuc Pattyn21-Aug-09 4:21 
GeneralRe: ObjectDisposedException within a while loop? Pin
Trapper-Hell23-Aug-09 20:19
Trapper-Hell23-Aug-09 20:19 
GeneralRe: ObjectDisposedException within a while loop? Pin
Luc Pattyn24-Aug-09 2:46
sitebuilderLuc Pattyn24-Aug-09 2:46 
GeneralRe: ObjectDisposedException within a while loop? Pin
Trapper-Hell24-Aug-09 20:19
Trapper-Hell24-Aug-09 20:19 
Questionhow to sync the data of two table? Pin
Tridip Bhattacharjee21-Aug-09 1:55
professionalTridip Bhattacharjee21-Aug-09 1:55 
AnswerRe: how to sync the data of two table? Pin
xstoneheartx21-Aug-09 3:28
xstoneheartx21-Aug-09 3:28 
AnswerRe: how to sync the data of two table? Pin
Mycroft Holmes21-Aug-09 17:08
professionalMycroft Holmes21-Aug-09 17:08 
Questionlink in dynamic menu Pin
rummer21-Aug-09 1:48
rummer21-Aug-09 1:48 
AnswerBad forum etiquette - don't post the same thing more than once Pin
Pete O'Hanlon21-Aug-09 1:56
mvePete O'Hanlon21-Aug-09 1:56 
GeneralRe: Bad forum etiquette - don't post the same thing more than once Pin
EliottA21-Aug-09 2:49
EliottA21-Aug-09 2:49 
QuestionToolStrip Scrolling Pin
Tiger45621-Aug-09 1:19
Tiger45621-Aug-09 1:19 
AnswerRe: ToolStrip Scrolling Pin
xstoneheartx21-Aug-09 3:40
xstoneheartx21-Aug-09 3:40 
QuestionDynamic menu Pin
rummer21-Aug-09 0:58
rummer21-Aug-09 0:58 
QuestionHow to open multiple pdf files Pin
kanchoette21-Aug-09 0:54
kanchoette21-Aug-09 0:54 
AnswerRe: How to open multiple pdf files Pin
stancrm21-Aug-09 0:58
stancrm21-Aug-09 0:58 
QuestionCan I use RequireFieldValidator or should I just try to write code to check two textboxes entry? Pin
vanillaET21-Aug-09 0:27
vanillaET21-Aug-09 0:27 

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.