0

I want that when txt file data save in database that time progress display that "Processing nth of n records …" I trying with following code but not success

 CurrentFileName = myFile.FileName;
            string CurrentPath = Server.MapPath("~/Uploadfile/");   
            CurrentPath += CurrentFileName;
            myFile.SaveAs(CurrentPath);
            fname = CurrentFileName;
            DataTable dt = new DataTable();
            StreamReader sw = new StreamReader(CurrentPath);
            var linecount = File.ReadAllLines(CurrentPath).Length;
            //lblmsg1.Text = linecount.ToString();
            while (!sw.EndOfStream)
            {
                count++;
                lblmsg1forcount.Text = " processing" + count.ToString() + "th  Of" + linecount.ToString() + " Records .......";
                string[] partsOfString = sw.ReadLine().Split('~');
                string str1 = partsOfString[0];
                string str2 = partsOfString[1];
                string str = partsOfString[2];
                string str3 = partsOfString[3];
                string str4 = partsOfString[4];
            }
2
Contributors
1
Reply
5
Views
4 Years
Discussion Span
Last Post by JorgeM
0

What wasn't a success?

Keep in mind that all of the processing happens server side and when its completed, the results are sent back to the browser as HTML.

If you want to create some type of real time progress/status bar, you'll need a client side solution that receives data from the server in real time.

Edited by JorgeM

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.