A
ad
I have a method in WebServcie, which retrun a DataTable:
[WebMethod]
public DataTable GetSchoolList()
{
string sSql = "Select ....";
DataTable dt ;
.........
return dt;
}
In the consume application, I have add the reference to that web service,
and use the codes to get the datatabe.
localhost.Health wsHealth = new localhost.Health();
DataTable dt = (DataTable)wsHealth.GetSchoolList("413");
But it result in an error when compile:
Error 21 Cannot convert type
'localhost.GetSchoolListResponseGetSchoolListResult' to
'System.Data.DataTable'
I thought the return type is DataTable, why it become to
GetSchoolListResponseGetSchoolListResult?
[WebMethod]
public DataTable GetSchoolList()
{
string sSql = "Select ....";
DataTable dt ;
.........
return dt;
}
In the consume application, I have add the reference to that web service,
and use the codes to get the datatabe.
localhost.Health wsHealth = new localhost.Health();
DataTable dt = (DataTable)wsHealth.GetSchoolList("413");
But it result in an error when compile:
Error 21 Cannot convert type
'localhost.GetSchoolListResponseGetSchoolListResult' to
'System.Data.DataTable'
I thought the return type is DataTable, why it become to
GetSchoolListResponseGetSchoolListResult?