D
D
I have a winforms app that I'm reading some records from a datareader and
writing them out to a file like so
SqlDataReader dataReader = sqlCommand.ExecuteReader();
TextWriter textWriter = new StreamWriter(strFileName);
while(drReader.Read())
{
strRecord = ////// strRecord building stuff here
textWriter.WriteLine(strRecord);
iRecordCount++;
}
textWriter.Close();
This code works fine in debug mode and release mode on win XP but fails
release mode on win2000. It doesn't fail as in throw any exceptions or any
errors and appears to work fine but no file is created. Everything appears
to work but I have no file.
strFileName is formed by a number of variables but ultimately looks
something like this
c:\XDataFiles\DataFiles\2006\XData_06_21_2006.txt
if instead of using strFileName, I hard code it to
TextWriter textWriter = new
StreamWriter(@"c:\XDataFiles\DataFiles\2006\XData_06_21_2006.txt");
it works fine then and creates a data file for me.
So I'm very confused as to why this is. I don't have the IDE installed on my
win2000 machine so I can't step into debug mode, its for release testing.
Anyone have any ideas?
Thanks
writing them out to a file like so
SqlDataReader dataReader = sqlCommand.ExecuteReader();
TextWriter textWriter = new StreamWriter(strFileName);
while(drReader.Read())
{
strRecord = ////// strRecord building stuff here
textWriter.WriteLine(strRecord);
iRecordCount++;
}
textWriter.Close();
This code works fine in debug mode and release mode on win XP but fails
release mode on win2000. It doesn't fail as in throw any exceptions or any
errors and appears to work fine but no file is created. Everything appears
to work but I have no file.
strFileName is formed by a number of variables but ultimately looks
something like this
c:\XDataFiles\DataFiles\2006\XData_06_21_2006.txt
if instead of using strFileName, I hard code it to
TextWriter textWriter = new
StreamWriter(@"c:\XDataFiles\DataFiles\2006\XData_06_21_2006.txt");
it works fine then and creates a data file for me.
So I'm very confused as to why this is. I don't have the IDE installed on my
win2000 machine so I can't step into debug mode, its for release testing.
Anyone have any ideas?
Thanks