ORIGINAL: Germ
privatebool DataSetToFile(DataSet dsUsers, string fldSep, string lineSep,
string destPathName, bool overwriteIfExist)
{
StringBuilder sb = newStringBuilder();
foreach (DataRow row in dsUsers.Tables[0].Rows)
{
string line = "";
for (int i = 0; i < row.Table.Columns.Count; i++)
{
if (line.Length > 0)
{
line = line + fldSep;
}
line = line + row.ToString();
}
sb.Append(line + lineSep);
}
// clean up
dsUsers = null;
m_sqlConn.Close();
m_sqlConn = null;
bool exists = File.Exists(destPathName);
if (overwriteIfExist == true)
{
using (StreamWriter sw = File.CreateText(destPathName))
{
sw.Write(sb);
}
}
else
{
MessageBox.Show("File Already Exist, Please Rename");
returnfalse;
}
returntrue;
}
huh? 