TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Faisal Ansari
NA
451
833.8k
Exception occur with web service
Aug 27 2011 6:45 AM
hello guys how r u ?
i am in problem with web service and exception occur which i unable to understand kindly help me about it .
my code is given below,
service url: http://www.webservicex.net/CurrencyConvertor.asmx.
csharp code:
=============
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Web.Services;
using System.Web.Services.Description;
using CurrencyConvertor;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
ddlFrom.DataSource = Enum.GetValues(typeof(CurrencyConvertor.Currency));
ddlFrom.DataBind();
ddlTo.DataSource = Enum.GetValues(typeof(CurrencyConvertor.Currency));
ddlTo.DataBind();
}
lblMessage.Visible = false;
}
protected void btnConvert_Click(object sender, EventArgs e)
{
if (txtAmount.Text != null && txtAmount.Text != "")
{
CurrencyConvertor.CurrencyConvertor conver = new CurrencyConvertor.CurrencyConvertor();
CurrencyConvertor.Currency From = (CurrencyConvertor.Currency)Enum.Parse(typeof(CurrencyConvertor.Currency), ddlFrom.SelectedValue.ToString(), true);
CurrencyConvertor.Currency To = (CurrencyConvertor.Currency)Enum.Parse(typeof(CurrencyConvertor.Currency), ddlTo.SelectedValue.ToString(), true);
double d = conver.ConversionRate(From, To);
lblMessage.Visible = true;
lblMessage.Text = (d * Convert.ToDouble(txtAmount.Text)).ToString();
}
else
{
lblMessage.Visible = true;
lblMessage.ForeColor = System.Drawing.Color.Red;
lblMessage.Text = "Please Enter The Amount First !!!";
}
}
}
Reply soon
its urgent please.
thanks.
Reply
Answers (
1
)
How to create a webservice for iphone
Web browser security