码迷,mamicode.com
首页 > Web开发 > 详细

asp.net post方法;对象转json

时间:2014-10-22 09:58:25      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:io   os   java   for   sp   on   log   bs   new   

[System.Web.Services.WebMethod()]
    public static string GetPoints(string userId)
    {
        string strResult = string.Empty;
        try
        {
            List<IIMS_RTLocation> IIMS_RTLocationS = null;
            DataTable dt = MyHelper.DBScriptHelper.GetDataTableBySQL3(string.Format("select * from IIMS_RTLocation where UserId in({0})", userId.TrimEnd(‘,‘)));
            IIMS_RTLocationS = DataTableToList<IIMS_RTLocation>(dt);
            System.Web.Script.Serialization.JavaScriptSerializer json = new System.Web.Script.Serialization.JavaScriptSerializer();
            strResult = json.Serialize(IIMS_RTLocationS);
        }
        catch (Exception ex)
        {
            LogCommon.ilogError.Error(ex);
        }
        return strResult;
    }

asp.net post方法;对象转json

标签:io   os   java   for   sp   on   log   bs   new   

原文地址:http://www.cnblogs.com/qizhinan/p/4042290.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!