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

C#

 
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 
I think my problem here is the foreach loop. DO I need to use foreach? Can I structure this different to not use a foreach loop and avoid it from itterating so many times?

Code again:

    long sum = 0;
    foreach (imphash hsm in res)
    {
        sum += Convert.ToInt64(hsm.Field1.ToString());
        CalculateNum(sum);
    }
}

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


Excellence is doing ordinary things extraordinarily well.

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 
Questioncopy textbox data? Pin
Mr.Kode14-May-08 20:03
Mr.Kode14-May-08 20:03 
AnswerRe: copy textbox data? Pin
Christian Graus14-May-08 20:12
protectorChristian Graus14-May-08 20:12 
GeneralRe: copy textbox data? Pin
Mr.Kode14-May-08 20:22
Mr.Kode14-May-08 20:22 
QuestionXPathDocument Constructor Pin
George_George14-May-08 19:58
George_George14-May-08 19:58 
QuestionCommunication between form and DLLs...IPC? Pin
Adeel Chaudhry14-May-08 18:57
Adeel Chaudhry14-May-08 18:57 
AnswerRe: Communication between form and DLLs...IPC? Pin
Christian Graus14-May-08 19:52
protectorChristian Graus14-May-08 19:52 
QuestionCell validation in datagridview Pin
cocoonwls14-May-08 18:55
cocoonwls14-May-08 18:55 
AnswerRe: Cell validation in datagridview Pin
dan!sh 14-May-08 19:06
professional dan!sh 14-May-08 19:06 
GeneralRe: Cell validation in datagridview [modified] Pin
cocoonwls14-May-08 20:35
cocoonwls14-May-08 20:35 
Questioncreate a new window using a buttton Pin
EricFelix14-May-08 17:21
EricFelix14-May-08 17:21 
AnswerRe: create a new window using a buttton Pin
Christian Graus14-May-08 17:28
protectorChristian Graus14-May-08 17:28 

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.