This blog is about the dotnet.all types of codes,news about dotnet including asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.ncluding asp.net,vb.net,c# and know about new dotnet technology.programing in asp.net,vb.net,c#, ajax, AJAX tech support for .net and discuss the new technology in dotnet.asp.net programming,dot net programming,dotnet programs,dotnet source code,source code.

Free Hosting

Free Hosting

Friday, May 16, 2008

Free Currency Conversion webservice in .net

Sometimes the webapplications espcially ecommerce websites needs currency conversion services to show their product exact price in other currencies. We cant do it by just multiplying with other conversion rates as there currency rates always changes. Here in this article a currency conversion xml webservice is described. The sevice path is http://www.webservicex.net/CurrencyConvertor.asmx?wsdl..

Here i am describing how to use it in your asp.net application through C# implementation.

Steps to refer webservice.
1. Goto Explores window in Visual Studio.
2. Right click on project and select Add Web Reference from the context menu that opened after right clicking
3. Add web reference window will be opend. Now paste "http://www.webservicex.net/CurrencyConvertor.asmx?wsdl" on url address bar and click on go button.
4.After few seconds depending on your internet speed the service descrition and method will be shown to you. Just click on Add reference button to add this service to your project.

C# Code to implement this service

net.webservicex.www.CurrencyConvertor MyExRate = new net.webservicex.www.CurrencyConvertor();
double conversionRate = MyExRate.ConversionRate((net.webservicex.www.Currency)Enum.Parse(typeof(net.webservicex.www.Currency), "Currency Code From"), (net.webservicex.www.Currency)Enum.Parse(typeof(net.webservicex.www.Currency),"Currency COde To"));

double result = pricetoConvert * conversionRate;


Note: You have to replace Currency Code From and Currency Code to to respective Currency code

List of Supported Currency With their Currency Code

UAE Dirham-AED
Afghanistan Afghani-AFA
Albanian Lek-ALL
Neth Antilles Guilder-ANG
Argentine Peso-ARS
Australian Dollar-AUD
Aruba Florin-AWG
Barbados Dollar-BBD
Bangladesh Taka-BDT
Bahraini Dinar-BHD
Burundi Franc-BIF
Bermuda Dollar-BMD
Brunei Dollar-BND
Bolivian Boliviano-BOB
Brazilian Real-BRL
Bahamian Dollar-BSD
Bhutan Ngultrum-BTN
Botswana Pula-BWP
Belize Dollar-BZD
Canadian Dollar-CAD
Swiss Franc-CHF
Chilean Peso-CLP
Chinese Yuan-CNY
Colombian Peso-COP
Costa Rica Colon-CRC
Cuban Peso-CUP
Cape Verde Escudo-CVE
Cyprus Pound-CYP
Czech Koruna-CZK
Dijibouti Franc-DJF
Danish Krone-DKK
Dominican Peso-DOP
Algerian Dinar-DZD
Estonian Kroon-EEK
Egyptian Pound-EGP
Ethiopian Birr-ETB
Euro-EUR
Falkland Islands Pound-FKP
British Pound-GBP
Ghanian Cedi-GHC
Gibraltar Pound-GIP
Gambian Dalasi-GMD
Guinea Franc-GNF
Guatemala Quetzal-GTQ
Guyana Dollar-GYD
Hong Kong Dollar-HKD
Honduras Lempira-HNL
Croatian Kuna-HRK
Haiti Gourde-HTG
Hungarian Forint-HUF
Indonesian Rupiah-IDR
Israeli Shekel-ILS
Indian Rupee-INR
Iraqi Dinar-IQD
Iceland Krona-ISK
Jamaican Dollar-JMD
Jordanian Dinar-JOD
Japanese Yen-JPY
Kenyan Shilling-KES
Cambodia Riel-KHR
Comoros Franc-KMF
North Korean Won-KPW
Korean Won-KRW
Kuwaiti Dinar-KWD
Cayman Islands Dollar-KYD
Kazakhstan Tenge-KZT
Lao Kip-LAK
Lebanese Pound-LBP
Sri Lanka Rupee-LKR
Liberian Dollar-LRD
Lesotho Loti-LSL
Lithuanian Lita-LTL
Latvian Lat-LVL
Libyan Dinar-LYD
Moroccan Dirham-MAD
Moldovan Leu-MDL
Malagasy Franc-MGF
Macedonian Denar-MKD
Myanmar Kyat-MMK
Mongolian Tugrik-MNT
Macau Pataca-MOP
Mauritania Ougulya-MRO
Maltese Lira-MTL
Mauritius Rupee-MUR
Maldives Rufiyaa-MVR
Malawi Kwacha-MWK
Mexican Peso-MXN
Malaysian Ringgit-MYR
Mozambique Metical-MZM
Namibian Dollar-NAD
Nigerian Naira-NGN
Nicaragua Cordoba-NIO
Norwegian Krone-NOK
Nepalese Rupee-NPR
New Zealand Dollar-NZD
Omani Rial-OMR
Panama Balboa-PAB
Peruvian Nuevo Sol-PEN
Papua New Guinea Kina-PGK
Philippine Peso-PHP
Pakistani Rupee-PKR
Polish Zloty-PLN
Paraguayan Guarani-PYG
Qatar Rial-QAR
Romanian Leu-ROL
Russian Rouble-RUB
Saudi Arabian Riyal-SAR
Solomon Islands Dollar-SBD
Seychelles Rupee-SCR
Sudanese Dinar-SDD
Swedish Krona-SEK
Singapore Dollar-SGD
St Helena Pound-SHP
Slovenian Tolar-SIT
Slovak Koruna-SKK
Sierra Leone Leone-SLL
Somali Shilling-SOS
Surinam Guilder-SRG
Sao Tome Dobra-STD
El Salvador Colon-SVC
Syrian Pound-SYP
Swaziland Lilageni-SZL
Thai Baht-THB
Tunisian Dinar-TND
Tonga Pa'anga-TOP
Turkish Lira-TRL
Turkey Lira-TRY
Trinidad & Tobago Dollar-TTD
Taiwan Dollar-TWD
Tanzanian Shilling-TZS
Ukraine Hryvnia-UAH
Ugandan Shilling-UGX
U.S. Dollar-USD
Uruguayan New Peso-UYU
Venezuelan Bolivar-VEB
Vietnam Dong-VND
Vanuatu Vatu-VUV
Samoa Tala-WST
CFA Franc (BEAC)-XAF
Silver Ounces-XAG
Gold Ounces-XAU
East Caribbean Dollar-XCD
CFA Franc (BCEAO)-XOF
Palladium Ounces-XPD
Pacific Franc-XPF
Platinum Ounces-XPT
Yemen Riyal-YER
Yugoslav Dinar-YUM
South African Rand-ZAR
Zambian Kwacha-ZMK
Zimbabwe Dollar-ZWD<

0 comments:

dotnet(.Net) Project Source code Downloads and Tutorials

Email Subscrption



Enter your email address:

Delivered by FeedBurner

Feedburner Count

Unique Visitor

Design by araba-cı | MoneyGenerator Blogger Template by GosuBlogger