Click here to Skip to main content
15,915,172 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi Here I need Code For converting one country currency into another country currency
Example
1)if we give input as Usd 1 Dollar it should display as 53.45 Indian rupees.
2)if we give input as Eur 1 pound it should display as 73.45 Indian rupees.

need code in Asp.net with C# Language
it should display values as per as market in present day (I mean that rupee value may change day by day)
here i am using web Services this web service
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL[^]
can any one tell the procedure how to call this web services in code
i have used this in on form load
C#
(here My web service name is CurrencyConvertor)
{
CurrencyConvertor.Currency Currency = default(CurrencyConvertor.Currency);
System.Array CountryList = default(System.Array);
CountryList = System.Currency.GetType();
//CountryList = Currency.GetValues(Currency.GetType);(here is Error)
Country1list.DataSource = CountryList;
Country1list.DataBind();
Country2list.DataSource = CountryList;
Country2list.DataBind();
}


again in button click(here its give lot of errors)
{
CurrencyConvertor.CurrencyConvertor CurrencyConvertor = new CurrencyConvertor.CurrencyConvertor();
CurrencyConvertor.Currency Currency = new CurrencyConvertor.Currency();
double dt = CurrencyConvertor.ConversionRate(System.Enum.Parse(Currency.GetType(), DropDownListFromCountry.Text), System.Enum.Parse(Currency.GetType(), DropDownListToCountry.Text));
Response.Write(string.Format("Converted Amount {0}", dt * Convert.ToDouble(TextBoxRes.Text.Trim)));
}
Posted
Updated 3-May-12 23:51pm
v2

This link may help you
http://forums.asp.net/t/1297305.aspx/1[^]
 
Share this answer
 
Dear Friend,

If Your Webservice Work Perfectly Then you can Call your Webservice in your project through add web reference.And Create one Object with that Reference then You can call ur Methods.
 
Share this answer
 
Comments
Raghu16 4-May-12 6:45am    
i have try calling the web services can u please once check the above code and fix the problem in above code
 
Share this answer
 
here you will find what you search about it
http://www.magic-dev.com/ajax-currency-converter-asp-net-google.htm[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900