本文介绍了怀疑c#中的webservices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai Guys

我对c#.net + asp.net webservices有一个疑问,我有三个这样的文本框

Textbox1 EmpId only Int like 123

TextBox2仅限Empname String喜欢sandeep,Miriyala,

TextBox3 EmpSalary只有6543.50的双倍跟随

提交时我有一个疑问



Webservices将收集



我的网络服务如下



EmpId-> TextBox1.value

EmpName-> TextBox2.value

EmpSal-> TextBox3.value

什么是用户将进入我发送到webservices方法的文本框我的webservices方法如下..

我知道默认值在asp文本框中由用户输入是字符串格式只是需要再次转换和再次在我的网站服务....



Hai Guys
I have one doubt in c#.net +asp.net 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

EmpId->TextBox1.value
EmpName->TextBox2.value
EmpSal->TextBox3.value
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;
FinalResult=Convert.ToInt32(EmpId)+Empname+Convert.Todouble(Empsal);
return FinalResult;
}





是否需要将文本框值转换为String如果需要如何将Double数据类型转换为String数据类型给我一些基本的例子我面临将双重转换为字符串的问题,请帮助我。





谢谢& Regrads

Sandeep Miriyala



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

推荐答案

string FormattedSalary = Empsal.ToString("C2"); 



会将您的工资字段转换为代表货币值的字符串,例如:

如果Empsal = 6346.47231

you将获得:


will convert your salary field to a string representing a currency value e.g.:
if Empsal = 6346.47231
you will get: "




这篇关于怀疑c#中的webservices的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 20:36