Hi John,
Here is the code I'm using , it comes from a PPC app and does exactly what you want
StreamWriter writer = new StreamWriter( Config.DataPath + "\\" + Config.OldOrdersFile, false);
writer.WriteLine("Tablename=OldOrders");
foreach(DataRow dr in _oldOrders.Tables[0].Rows )
{
StringBuilder builder = new StringBuilder( 200); // None row is bigger than this
foreach(object o in dr.ItemArray)
{
builder.Append( o.ToString() );
builder.Append( ',' );
}
builder.Remove( builder.Length-1, 1);
writer.WriteLine( builder.ToString() );
}
writer.Close();
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Does any one know how to write the data from a dataset table to a text file? I have found a clumsy way to do it using WriteXml, XmlReader, XmlNodeReader, etc, but this seems awful clumsy. Is there a better way to do this?