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

C#

 
GeneralRe: auto position Pin
dan!sh 14-May-08 22:07
professional dan!sh 14-May-08 22:07 
GeneralRe: auto position Pin
sunspeed14-May-08 22:11
sunspeed14-May-08 22:11 
GeneralRe: auto position Pin
dan!sh 14-May-08 22:40
professional dan!sh 14-May-08 22:40 
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 
Hi Guys. I need a little help with calculating a list of numbers. I'm importing a list of numbers and I would like to calculate the sum of these.

an example of this list of numbers is as follows.

<br />
300145639<br />
2240154504<br />
53370705579<br />
1984209469<br />
540191077<br />
1322660604<br />


I have this small bit of code which I know is wrong. Could somebody please guide me on how to do this corretly? I don't seem to get the correct total when running this. Any help would be greatly appreciated.

    foreach (imphash hsh in res)
    {
        CalculateNum(hsh.Field1.ToString());
    }
}

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


Excellence is doing ordinary things extraordinarily well.

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 
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 

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.