Click here to Skip to main content
14,659,593 members
Home » Discussions » C#
   

C#

 
Questioncall a jquery function inside html returned by ajax Pin
taiielmehdi00127-Jul-20 21:36
Membertaiielmehdi00127-Jul-20 21:36 
AnswerRe: call a jquery function inside html returned by ajax Pin
OriginalGriff27-Jul-20 22:02
mveOriginalGriff27-Jul-20 22:02 
QuestionAdd a listview cell Pin
ago248627-Jul-20 1:34
Memberago248627-Jul-20 1:34 
AnswerRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:28
mveOriginalGriff27-Jul-20 2:28 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 2:31
Memberago248627-Jul-20 2:31 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 2:59
mveOriginalGriff27-Jul-20 2:59 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 3:18
Memberago248627-Jul-20 3:18 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 3:37
mveOriginalGriff27-Jul-20 3:37 
So use the debugger to find out!
Start by breakpointing the line itself:
total_achat += Convert.ToDecimal(dataGridView1.Rows[i].Cells[4].Value);

When it hits for the first time, the total and the loop index should both be zero because that is what your code told them to be:
total_achat = 0;
...
for (int i = 0; i < dataGridView1.Rows.Count; i++)
After it, you will have added the cell value, so step over that line.
What's the value of the total now? If it's still zero, then it means that this code evaluates to zero:
Convert.ToDecimal(dataGridView1.Rows[i].Cells[4].Value)
So look at why that is: what's the value of dataGridView1.Rows[i].Cells[4].Value - use the debugger to find out by firstly hovering over word "Value" and if that looks "right" then adding the calculation to teh Watch pane.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:08
Memberago248627-Jul-20 4:08 
GeneralRe: Add a listview cell Pin
OriginalGriff27-Jul-20 4:38
mveOriginalGriff27-Jul-20 4:38 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:45
Memberago248627-Jul-20 4:45 
GeneralRe: Add a listview cell Pin
ago248627-Jul-20 4:53
Memberago248627-Jul-20 4:53 
Questionsaving a Word Doc from address bar in .net/C# Pin
Pita3225-Jul-20 5:50
MemberPita3225-Jul-20 5:50 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 7:19
mveGerry Schmitz25-Jul-20 7:19 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 9:22
professionalDerekT-P25-Jul-20 9:22 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Gerry Schmitz25-Jul-20 9:58
mveGerry Schmitz25-Jul-20 9:58 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
DerekT-P25-Jul-20 11:38
professionalDerekT-P25-Jul-20 11:38 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan25-Jul-20 21:59
mveRichard MacCutchan25-Jul-20 21:59 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Pita3226-Jul-20 6:37
MemberPita3226-Jul-20 6:37 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan26-Jul-20 6:46
mveRichard MacCutchan26-Jul-20 6:46 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard Deeming26-Jul-20 23:50
mveRichard Deeming26-Jul-20 23:50 
GeneralRe: saving a Word Doc from address bar in .net/C# Pin
Richard MacCutchan27-Jul-20 0:03
mveRichard MacCutchan27-Jul-20 0:03 
AnswerRe: saving a Word Doc from address bar in .net/C# Pin
Richard Deeming26-Jul-20 23:51
mveRichard Deeming26-Jul-20 23:51 
QuestionGet List Of SQL Foreign Keys Using C# Pin
Kevin Marois24-Jul-20 6:46
professionalKevin Marois24-Jul-20 6:46 
AnswerRe: Get List Of SQL Foreign Keys Using C# Pin
Richard Deeming24-Jul-20 7:29
mveRichard Deeming24-Jul-20 7:29 

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.