Click here to Skip to main content
15,907,225 members
Home / Discussions / C#
   

C#

 
GeneralRe: Listboxes ... finding certain numbers Pin
Luc Pattyn2-Mar-08 15:20
sitebuilderLuc Pattyn2-Mar-08 15:20 
GeneralRe: Listboxes ... finding certain numbers Pin
aj.esler2-Mar-08 14:49
aj.esler2-Mar-08 14:49 
GeneralRe: Listboxes ... finding certain numbers Pin
Jacob Dixon2-Mar-08 14:54
Jacob Dixon2-Mar-08 14:54 
AnswerRe: Listboxes ... finding certain numbers Pin
dipak.dipak2-Mar-08 19:25
dipak.dipak2-Mar-08 19:25 
QuestionHow to load Kernel32.dll and use GetSystemInfo(...) Pin
gshen2-Mar-08 12:59
gshen2-Mar-08 12:59 
AnswerRe: How to load Kernel32.dll and use GetSystemInfo(...) Pin
Anthony Mushrow2-Mar-08 14:14
professionalAnthony Mushrow2-Mar-08 14:14 
AnswerRe: How to load Kernel32.dll and use GetSystemInfo(...) Pin
Luc Pattyn2-Mar-08 15:22
sitebuilderLuc Pattyn2-Mar-08 15:22 
GeneralOpening multiple files Pin
Jacob Dixon2-Mar-08 10:16
Jacob Dixon2-Mar-08 10:16 
Source: mscorlib
Inner Exception:
Target: Void FileNotOpen()
Message: Cannot access a closed file.

I keep getting this error and can not figure it out.. I am actually opening a certain file and writing to it, then opening another one then writing to it and so on. Should I not be doing this? Is this causing maybe them not opening in time before it tries to write to them?

FileStream ChildFile = new FileStream(thepath + @"Child\Child.daycare", FileMode.Create);
StreamWriter Childsw = new StreamWriter(ChildFile);
                    Childsw.WriteLine(fullnameTextbox.Text);
                    Childsw.WriteLine(birthTextbox.Text);
                    Childsw.WriteLine(startTextbox.Text);
                    ChildFile.Close();
                    Childsw.Close();
                   
FileStream GuardianFile = new FileStream(thepath + @"Guardian\ParentGuardian.daycare", FileMode.Create);
StreamWriter Guardiansw = new StreamWriter(GuardianFile);
                    Guardiansw.WriteLine(guardNameTextbox.Text);
                    Guardiansw.WriteLine(relationTextbox.Text);
                    Guardiansw.WriteLine(textBox1.Text);
                    Guardiansw.WriteLine(CityStateZipTextbox.Text);
                    Guardiansw.WriteLine(EmployTextbox.Text);
                    Guardiansw.WriteLine(Guard2Textbox.Text);
                    Guardiansw.WriteLine(Relation2Textbox.Text);
                    Guardiansw.WriteLine(Address2Textbox.Text);
                    Guardiansw.WriteLine(CityStateZip2Textbox.Text);
                    Guardiansw.WriteLine(Employ2Textbox.Text);
                    GuardianFile.Close();
                    Guardiansw.Close();


There are more.. but should I be doing this a different way?
GeneralRe: Opening multiple files Pin
Giorgi Dalakishvili2-Mar-08 10:22
mentorGiorgi Dalakishvili2-Mar-08 10:22 
GeneralRe: Opening multiple files Pin
Jacob Dixon2-Mar-08 10:24
Jacob Dixon2-Mar-08 10:24 
GeneralRe: Opening multiple files Pin
Jacob Dixon2-Mar-08 10:28
Jacob Dixon2-Mar-08 10:28 
GeneralRe: Opening multiple files Pin
Giorgi Dalakishvili2-Mar-08 10:50
mentorGiorgi Dalakishvili2-Mar-08 10:50 
GeneralRe: Opening multiple files Pin
pmarfleet2-Mar-08 10:39
pmarfleet2-Mar-08 10:39 
Questionhow to save an office file to database? Pin
mahmoud wafy2-Mar-08 10:06
mahmoud wafy2-Mar-08 10:06 
GeneralRe: how to save an office file to database? Pin
Giorgi Dalakishvili2-Mar-08 10:18
mentorGiorgi Dalakishvili2-Mar-08 10:18 
Questioncopy part of table from one DB to table in another DB don't work Pin
evgenik2-Mar-08 8:44
evgenik2-Mar-08 8:44 
GeneralRe: copy part of table from one DB to table in another DB don't work Pin
Paul Conrad27-Mar-08 12:27
professionalPaul Conrad27-Mar-08 12:27 
Generalneed to open a spreadsheet document in a listView Pin
Walaza2-Mar-08 7:03
Walaza2-Mar-08 7:03 
GeneralFull Path to DOS Path Pin
Ian Uy2-Mar-08 5:10
Ian Uy2-Mar-08 5:10 
GeneralRe: Full Path to DOS Path Pin
DaveyM692-Mar-08 5:23
professionalDaveyM692-Mar-08 5:23 
GeneralRe: Full Path to DOS Path Pin
pmarfleet2-Mar-08 5:24
pmarfleet2-Mar-08 5:24 
QuestionHow can I Allow focus for multiple controls? Pin
eyalbi0072-Mar-08 4:30
eyalbi0072-Mar-08 4:30 
GeneralRe: How can I Allow focus for multiple controls? Pin
pmarfleet2-Mar-08 4:46
pmarfleet2-Mar-08 4:46 
GeneralRe: How can I Allow focus for multiple controls? Pin
eyalbi0072-Mar-08 5:17
eyalbi0072-Mar-08 5:17 
GeneralRe: How can I Allow focus for multiple controls? Pin
pmarfleet2-Mar-08 6:02
pmarfleet2-Mar-08 6:02 

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.