Click here to Skip to main content
15,893,508 members
Home / Discussions / C#
   

C#

 
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 
Kwagga, this has been answered 3 times now. Im not sure what it is you're not getting about this seemingly simple task. You have a list of numbers as strings, parse each number into an integer (as discussed you may need a bigger integer than int so use long) and sum them.

What your code does:

1) for each number in the list
2) parse it to a long

( good so far but... )

3) send the long to a method which converts it back to a string (list.ToString())
4) go character by character of the number and convert the original long back to a long (sum += Convert.ToInt64(list);)

( its getting worse... )

5) sum the number again.

For the final time (i hope) the second method is supervlous.
long sum = 0;
foreach (imphash hsm in res)
{
  sum += Convert.ToInt64(hsm.Field1.ToString());
}
txtboxdsptxt.Text =(sum.ToString());

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 
GeneralRe: create a new window using a buttton Pin
EricFelix14-May-08 17:37
EricFelix14-May-08 17:37 

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.