Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在客户端应用程序中获取对richTextBox的用户XML响应_C#_Sql_Web Services_Client - Fatal编程技术网

C# 在客户端应用程序中获取对richTextBox的用户XML响应

C# 在客户端应用程序中获取对richTextBox的用户XML响应,c#,sql,web-services,client,C#,Sql,Web Services,Client,我正在调用一个web服务函数,该函数正在从数据库中读取用户凭据 当直接从web服务中基于输入“搜索”整数调用时,响应为- <firstName>john</firstName> <lastName>smith</lastName> <sex>male</sex> <age>23</age> <search>100</search> 但是,这不起作用。根据您的评论 string

我正在调用一个web服务函数,该函数正在从数据库中读取用户凭据

当直接从web服务中基于输入“搜索”整数调用时,响应为-

<firstName>john</firstName>
<lastName>smith</lastName>
<sex>male</sex>
<age>23</age>
<search>100</search>
但是,这不起作用。

根据您的评论

string result = client.searchUser(search);
您正在尝试将at结构指定给字符串。这就是错误所在,编译器告诉您不能这样做

您应该在结构中重写
ToString()
方法,如

public override string ToString()
{
   // construct the string here which you want to assign
}
在你的客户方面

string result = client.searchUser(search).ToString();

希望它能有所帮助。

错误是什么?在哪一行?无法将类型“WebService.downloadUser”隐式转换为“string”,后者是WebService中创建数组的结构体[]
string result = client.searchUser(search).ToString();