TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Singh
1.5k
212
9.9k
Read a large Text File ( 250 MB) And Write in TextBox C#
Jan 30 2018 12:39 AM
i am Working on a Project on tech asp.net C#
I Have a Notepad file almost 250 MB i want to Write its Text on TextBox
I used this Code but it taking too much time at last Throwing error
OutOfMemoryException
any one can suggest me what is the Easiest way.
Here is the Code Below.
StringBuilder fileText = new StringBuilder();
using (FileStream fs = File.Open(FilePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (BufferedStream bs = new BufferedStream(fs))
using (StreamReader sr = new StreamReader(bs))
{
string line = "";
txtReader.Text = "";
while ((line = sr.ReadLine()) != null)
{
//fileText.AppendLine(line);
txtReader.Text += line.ToString();
}
}
txtReader.Text = fileText.ToString();
Reply
Answers (
7
)
How to insert to multiple tables using single excel file??
i want to insert two table data and then show both table dat