Click here to Skip to main content
13,094,983 members (83,166 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hai Guys
I have one doubt in webservices , I have three text boxes like this
Textbox1 EmpId only Int like 123
TextBox2 Empname only String likes sandeep, Miriyala,
TextBox3 EmpSalary only double like 6543.50 paise follows
I have one doubt while submiting buttion

Webservices will collected

My webservices is as follows

what are the user will entered the textbox I am sending to webservices method My webservices method is as follows..
I know that By default value in asp textboxes enter by user is String format only is it requied to convert again and again in my webservices ....

protected string  AddDetails(int EmpId, String  Empname, Double Empsal)
String FinalResult;
return FinalResult;

Is it required to convert the textboxes values to String if it is required How to convert Double datatype to String datatype Gave me some basic example I am facing some problem converting the double to string , Please help me.

Thanks& Regrads
Sandeep Miriyala
Posted 28-Jan-13 2:06am
Gittu Dash 28-Jan-13 8:34am
I think 'Convert.ToDouble' should work.
Are you sure it's not working ??
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi Sandeep,

Check out the following example:
string FormattedSalary = Empsal.ToString("C2"); 

will convert your salary field to a string representing a currency value e.g.:
if Empsal = 6346.47231
you will get: "$6346.47" (according to the localization of course)

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

Solution 2

I got the solution By default HTML Textbox take it as String data type, that reason, I can changed method, String data type. I changed the method is as follows, according to my point of view it is correct

protected string AddDetails(String EmpId, String Empname, String Empsal)

String FinalResult;
return FinalResult;

here no needed to typecast the double to string , int to string.
Thanks &Regrads
Sandeep M

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 28 Jan 2013
Copyright © CodeProject, 1999-2017
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