Click here to Skip to main content
15,890,690 members
Home / Discussions / C#
   

C#

 
GeneralRe: auto position Pin
sunspeed14-May-08 22:43
sunspeed14-May-08 22:43 
GeneralRe: auto position Pin
dan!sh 14-May-08 22:53
professional dan!sh 14-May-08 22:53 
GeneralRe: auto position Pin
sunspeed14-May-08 23:08
sunspeed14-May-08 23:08 
GeneralRe: auto position Pin
sunspeed14-May-08 22:08
sunspeed14-May-08 22:08 
QuestionAdvice on Calculation Pin
MumbleB14-May-08 20:57
MumbleB14-May-08 20:57 
AnswerRe: Advice on Calculation Pin
Eduard Keilholz14-May-08 21:08
Eduard Keilholz14-May-08 21:08 
AnswerRe: Advice on Calculation Pin
Christian Graus14-May-08 21:11
protectorChristian Graus14-May-08 21:11 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 21:38
MumbleB14-May-08 21:38 
Thanks Christian. I did this and for some strange reason I only get the last number in the list returned instead of the sum of all the numbers.

    foreach (imphash hsh in res)
    {
        txtboxdisplay.Text += hsh.Field1 + Environment.NewLine;
        CalculateNum(hsh.Field1.ToString());
    }
}

void CalculateNum(string list)
{
    long sum = 0;
    for (long i = 0; i < list.Length; i++)
    {
        sum += Convert.ToInt32(list);
        txtboxdsptxt.Text =(sum.ToString() + Environment.NewLine);
    }
}


I have also noticed that it seems to itterate throught the CalculateNum function a number of times before returning to foreach(imphash hsh in res).

These are the values in the file that I'm importing. (Just a few numbers for testing)

300145639
1984209469
540191077
1322660604

The sum returned is 13226606040. I'm expecting it to return 4147206789.

Anything else I might be missing?

Thanks for helping.

Excellence is doing ordinary things extraordinarily well.

GeneralRe: Advice on Calculation Pin
CPallini14-May-08 21:56
mveCPallini14-May-08 21:56 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 22:06
MumbleB14-May-08 22:06 
GeneralRe: Advice on Calculation Pin
CPallini14-May-08 22:19
mveCPallini14-May-08 22:19 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 22:32
MumbleB14-May-08 22:32 
GeneralRe: Advice on Calculation Pin
J4amieC14-May-08 22:33
J4amieC14-May-08 22:33 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 22:44
MumbleB14-May-08 22:44 
GeneralRe: Advice on Calculation Pin
CPallini14-May-08 22:48
mveCPallini14-May-08 22:48 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 22:57
MumbleB14-May-08 22:57 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 23:08
MumbleB14-May-08 23:08 
GeneralRe: Advice on Calculation Pin
J4amieC14-May-08 22:33
J4amieC14-May-08 22:33 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 22:48
MumbleB14-May-08 22:48 
GeneralRe: Advice on Calculation Pin
J4amieC14-May-08 23:27
J4amieC14-May-08 23:27 
GeneralRe: Advice on Calculation Pin
MumbleB14-May-08 23:52
MumbleB14-May-08 23:52 
QuestionFTP IN C# Pin
JABIR E14-May-08 20:57
JABIR E14-May-08 20:57 
AnswerRe: FTP IN C# Pin
Arjun Marwaha14-May-08 22:38
Arjun Marwaha14-May-08 22:38 
Questionwhere to place "restart code" Pin
prasadbuddhika14-May-08 20:49
prasadbuddhika14-May-08 20:49 
AnswerRe: where to place "restart code" Pin
#realJSOP14-May-08 23:27
mve#realJSOP14-May-08 23:27 

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.