Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem in DataSet Pin
Kaushal Arora9-Feb-09 23:53
Kaushal Arora9-Feb-09 23:53 
AnswerRe: Problem in DataSet Pin
Abdul Rahman Hamidy10-Feb-09 1:10
Abdul Rahman Hamidy10-Feb-09 1:10 
GeneralRe: Problem in DataSet Pin
Kaushal Arora6-Apr-09 23:05
Kaushal Arora6-Apr-09 23:05 
NewsMyBrowser - Kickstart C# , Make your own Web Browser in few easy steps Pin
three6t9-Feb-09 21:24
three6t9-Feb-09 21:24 
GeneralRe: MyBrowser - Kickstart C# , Make your own Web Browser in few easy steps Pin
musefan9-Feb-09 23:24
musefan9-Feb-09 23:24 
GeneralRe: MyBrowser - Kickstart C# , Make your own Web Browser in few easy steps Pin
Mycroft Holmes10-Feb-09 1:25
professionalMycroft Holmes10-Feb-09 1:25 
GeneralRe: MyBrowser - Kickstart C# , Make your own Web Browser in few easy steps Pin
EliottA10-Feb-09 3:02
EliottA10-Feb-09 3:02 
QuestionStreamReader + ProgressBar Help Pin
MumbleB9-Feb-09 20:46
MumbleB9-Feb-09 20:46 
Hi Guys. I am in the process of making my app slightly more efficient. I have been using the FileHelpers engin previously but it it was too slow in that it reads the whole file into the Array before processing it. I have changed this to use a StreamReader instead which speeds up the processing of the file dramatically as it reads one line at a time. Now, my problem is that I can't seem to get my progressbar to work properly. It seems to reach 100% before the full file has been processed. Anybody have any ideas? I have Googled and can't find an appriopriate solution for it. Below my Progressbar code.

private void UpdateProgress()
{
    string filepath;
    filepath = txtboxSelectTxtFile.Text;

    FileInfo fi = new FileInfo(filepath);
        progressBar1.Minimum = 0;
        progressBar1.Maximum = Convert.ToInt32(fi.Length) / 1000;
        progressBar1.Value = progressBar1.Value + 1;
        int progrval = 0;
        progrval = progressBar1.Value;
        progrval = progrval + 1;
        lblProgress.Text = ((progrval * 100) / Convert.ToInt32(progressBar1.Maximum)).ToString();
        lblProgress.Refresh();
        lblPercent2.Refresh();
        lblRecordProcessed.Text = progrval.ToString();
        lblProgText.Refresh();
        lblRecordProcessed.Refresh();

}


The error I get is "Value of '237' is not a valid value. Value must be between minimum ad maximum.

From this I take it that I am not calculating the Max value correctly. I see no other way to the max value than using FileInfo.

Excellence is doing ordinary things extraordinarily well.

AnswerRe: StreamReader + ProgressBar Help Pin
ABitSmart9-Feb-09 23:56
ABitSmart9-Feb-09 23:56 
AnswerRe: StreamReader + ProgressBar Help Pin
musefan10-Feb-09 0:01
musefan10-Feb-09 0:01 
GeneralRe: StreamReader + ProgressBar Help Pin
MumbleB10-Feb-09 0:07
MumbleB10-Feb-09 0:07 
GeneralRe: StreamReader + ProgressBar Help Pin
musefan10-Feb-09 0:17
musefan10-Feb-09 0:17 
GeneralRe: StreamReader + ProgressBar Help Pin
ABitSmart10-Feb-09 1:22
ABitSmart10-Feb-09 1:22 
GeneralRe: StreamReader + ProgressBar Help Pin
MumbleB10-Feb-09 2:25
MumbleB10-Feb-09 2:25 
QuestionSimple Midia player code Pin
Member 39168569-Feb-09 20:38
Member 39168569-Feb-09 20:38 
AnswerRe: Simple Midia player code Pin
Rob Philpott9-Feb-09 21:21
Rob Philpott9-Feb-09 21:21 
AnswerRe: Simple Midia player code Pin
MumbleB9-Feb-09 21:23
MumbleB9-Feb-09 21:23 
QuestionHow to create vertical menu by C#2005 Pin
dungpapai9-Feb-09 20:17
dungpapai9-Feb-09 20:17 
AnswerRe: How to create vertical menu by C#2005 Pin
Vimalsoft(Pty) Ltd9-Feb-09 23:32
professionalVimalsoft(Pty) Ltd9-Feb-09 23:32 
QuestionC# code for dongle Pin
Gopal_Kanchana9-Feb-09 20:11
Gopal_Kanchana9-Feb-09 20:11 
AnswerRe: C# code for dongle Pin
V.9-Feb-09 20:22
professionalV.9-Feb-09 20:22 
QuestionProblem in Infragestics Control Pin
vinay_K9-Feb-09 19:57
vinay_K9-Feb-09 19:57 
AnswerRe: Problem in Infragestics Control Pin
vinay_K10-Feb-09 18:31
vinay_K10-Feb-09 18:31 
QuestionReading Image streams from panel control usnig C#.net Pin
sreeraj.a.179-Feb-09 19:54
sreeraj.a.179-Feb-09 19:54 
Questionregistration form Pin
milapjp9-Feb-09 19:53
milapjp9-Feb-09 19:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.