我已经google了很多,但我找不到任何解决方案:
pip install -I
获得回复时我收到 public class WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string GetStudentInfo(int SerialNo)
{
Student obj = new Student();
if (SerialNo is int)
{
int Serial = SerialNo;
Student Stu;
var da = new SqlDataAdapter("SELECT * from Courserecord where SNO='" + Serial + "'", con);
var dt = new DataTable();
da.Fill(dt);
foreach (DataRow dr in dt.Rows)
{
Stu = new Student
{
SerialNo = Convert.ToInt32(dr["SNO"]),
StudentName = dr["StudentName"].ToString(),
Gender = dr["gender"].ToString(),
CollegeName = dr["CollegeName"].ToString(),
FathersName = dr["FatherName"].ToString(),
MotherName = dr["MotherName"].ToString(),
Address = dr["Address"].ToString(),
City = dr["City"].ToString(),
State = dr["State"].ToString(),
ContactNo = dr["ContactNO"].ToString(),
EmailId = dr["Emailid"].ToString(),
//
Course = dr["Course"].ToString(),
DateFrom = dr["DateFrom"].ToString(),
DateTo = dr["DateTo"].ToString(),
Department = dr["Department"].ToString(),
};
return new JavaScriptSerializer().Serialize(Stu).ToString();
}
}
标记。我们怎样才能删除这个请求帮助。
答案 0 :(得分:0)
XmlDocument _doc = new XmlDocument();
_doc.LoadXml(_data);
return Request.CreateResponse(HttpStatusCode.OK, JObject.Parse(_doc.InnerText));