Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to save record data in txt file by c# code.
if anyone having code please forward it.
thanks in advance....
Posted
Comments
[no name] 10-Aug-12 9:19am    
What kind of problem description is this? Where is the code that demonstrates any kind of a problem?

1. To read gridview data (datatable) and write it in text file.
http://forums.asp.net/t/1674836.aspx/1[^]

2. To write normal multiline textbox control in to text file.
http://www.gridview.net/write-text-file-in-c/[^]

3.In general how to write text file using c#
http://www.c-sharpcorner.com/uploadfile/mahesh/how-to-write-to-a-text-file-in-C-Sharp/[^]
 
Share this answer
 
Please check How to: Write to a Text File (C# Programming Guide)[^].

I have used this code before some days...
 
Share this answer
 
You can try with just 3 lines of code..

// create reader & open file
TextWriter tr = new StreamWriter(@"C:\" + "yourSavedData.txt");

// read a line of text
tr.Write(richTextBox1.Text);   //richtextbox.text may be your record

// close the stream
tr.Close();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900