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
Srinivas M
NA
435
29.3k
How to perform Seek operation on a ConnectStream.
Mar 1 2019 1:05 AM
This is my code below shown.Actually, I'm trying to read data from streamreader in the middle due to network problem getting exception message: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
To resume that stream, during data insertion into db at the same time inserting line count in to table. A fter problem occured then get the line count value form the db and try to perform seek operation on that stream but getting below exception.
this stream does not support seek operations
Please resolve it, if anyone get solved appreciated.
HttpWebResponse res = (HttpWebResponse)httpRequest.GetResponse();
Stream stream = res.GetResponseStream();
using (StreamReader sr = new StreamReader(stream))
{
string line = sr.ReadLine();
sr.BaseStream.Seek(8378, SeekOrigin.Begin);
}
//8378 line count inserted in db
Reply
Answers (
1
)
ref and out in c#
"" data with comma into one col while csv to datatable