Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 16th, 2006, 02:58 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default save dataset in txt format???

Hi;

there is a way to save the dataset contents in a TXT format??

thanks....
 
Old March 16th, 2006, 07:10 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Take a look at the DataSet.WriteXml Method: http://msdn.microsoft.com/library/de...texmltopic.asp

- A.Kahtava
 
Old March 17th, 2006, 11:06 AM
Authorized User
 
Join Date: Mar 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another approach would be to iterate through the rows of each table in the dataset and save as comma separated value (.csv) file (for each table). This way, you can open the saved files in most of the standard spreadsheet programs like Excel and Lotus-1-2-3.

One possible issue with this approach is that you lose the data-type formatting of columns.

Sreeram
 
Old March 20th, 2006, 01:29 PM
Authorized User
 
Join Date: Jun 2003
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi;

thanks for everyone, but i use the samples in the link below to solve my problem...

http://support.microsoft.com/?kbid=3...22120121120120

in this case i use the OleDbDataReader object and a System.IO.StreamWriter object for create the txt file...

the txt file can be open with excell.....





Similar Threads
Thread Thread Starter Forum Replies Last Post
export to txt format mallick_kuet Crystal Reports 0 January 21st, 2007 02:50 AM
export in txt format mallick_kuet C# 2005 0 January 20th, 2007 06:24 AM
export in txt format mallick_kuet BOOK: Professional Crystal Reports for VS.NET 0 January 20th, 2007 05:22 AM
save file in csv, txt format in jsp URGENT ernidhi2003 JSP Basics 1 October 14th, 2004 04:59 PM
How do I Save a form's contents into a .txt file flyingfox Pro VB.NET 2002/2003 2 March 28th, 2004 01:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.