Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SOAP
Hi,
I have a paypal element on my website and am really struggling with.
 
This part I am trying to draw a total for the datatable which is formatted to display in currency.
 
The error is a Format Exception "Input string was not in a correct format."
 
my code is
 
PaymentDetailsType pdt = new PaymentDetailsType()
{
OrderDescription = "Payment Details Sushant",
OrderTotal = new BasicAmountType()
{
currencyID = CurrencyCodeType.GBP,
Value = BasicAmountType(double.Parse(lblgTotal.Text))
}
};
 
I suspect it is the "Value" it is required to be a BasicAmountType.
How can I change the format to "String.BasicAmountType.Value"
Posted 5-Feb-13 0:30am
Edited 5-Feb-13 0:54am
v3
Comments
Ankur\m/ at 5-Feb-13 7:42am
   
Please use 'Have a Question or Comment' link below an answer to discuss with the answerer. Adding an answer doesn't notify him and thus he may not know about your comment.
I have moved your comment to the correct place.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Don't convert your value to Double. Try this
 
   Value = BasicAmountType(lblgTotal.Text)
  Permalink  
Comments
Ankur\m/ at 5-Feb-13 7:39am
   
[moved from answer]
That doesn't work. "Input string was not in a correct format. "

The £ sign needs to be removed from the label text.
Member 9599975 at 5-Feb-13 9:32am
   
That didn't work. "Input string was not in a correct format. "

The £ sign needs to be removed from the label text.
 
I found a solution to that problem create another label without the currency but made it not visible and referenced that label instead.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100